]> granicus.if.org Git - clang/commitdiff
When substituting tabs during HTMLification, only add " " when we are
authorTed Kremenek <kremenek@apple.com>
Tue, 8 Apr 2008 22:28:15 +0000 (22:28 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 8 Apr 2008 22:28:15 +0000 (22:28 +0000)
"escaping" spaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49404 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Rewrite/HTMLRewrite.cpp

index 25444bf89e02cfa5fd5c018003331843f694438b..8bc44e3a819d8fca697796b8d9ac02e403020126 100644 (file)
@@ -42,7 +42,12 @@ void html::EscapeText(Rewriter& R, unsigned FileID, bool EscapeSpaces) {
 
       case '\t': {
         SourceLocation Loc = SourceLocation::getFileLoc(FileID, FilePos);
-        R.ReplaceText(Loc, 1, "&nbsp;&nbsp;&nbsp;&nbsp;", 6*4);
+        
+        if (EscapeSpaces)
+          R.ReplaceText(Loc, 1, "&nbsp;&nbsp;&nbsp;&nbsp;", 6*4);
+        else
+          R.ReplaceText(Loc, 1, "    ", 4);
+        
         break;
       }