summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-08 22:28:15 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-08 22:28:15 +0000
commitb1f773ca989970a3da9b07a0d28f3c4195f38e8a (patch)
tree6e356fd40a1287794149daa2c5f5aea09ee3c9f5 /clang/lib/Rewrite
parentd8256ed2fe7581210d74abcb0adc28c2f5913c65 (diff)
downloadbcm5719-llvm-b1f773ca989970a3da9b07a0d28f3c4195f38e8a.tar.gz
bcm5719-llvm-b1f773ca989970a3da9b07a0d28f3c4195f38e8a.zip
When substituting tabs during HTMLification, only add "&nbsp;" when we are
"escaping" spaces. llvm-svn: 49404
Diffstat (limited to 'clang/lib/Rewrite')
-rw-r--r--clang/lib/Rewrite/HTMLRewrite.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Rewrite/HTMLRewrite.cpp b/clang/lib/Rewrite/HTMLRewrite.cpp
index 25444bf89e0..8bc44e3a819 100644
--- a/clang/lib/Rewrite/HTMLRewrite.cpp
+++ b/clang/lib/Rewrite/HTMLRewrite.cpp
@@ -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;
}
OpenPOWER on IntegriCloud