diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-03-19 07:53:42 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-03-19 07:53:42 +0000 |
commit | 13e479b2b74771738a5e5c5dc1c270416924b126 (patch) | |
tree | aaae19db0db5691858c6017e4ee56e77317fb53d /lib/Rewrite/HTMLRewrite.cpp | |
parent | 0fdf06e5eef80ce56ce6499ba662453919b95af1 (diff) |
Initial experimentation with adding boxed "annotations" to HTMLized source.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48540 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite/HTMLRewrite.cpp')
-rw-r--r-- | lib/Rewrite/HTMLRewrite.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Rewrite/HTMLRewrite.cpp b/lib/Rewrite/HTMLRewrite.cpp index 9690ecb74a..dcbf181980 100644 --- a/lib/Rewrite/HTMLRewrite.cpp +++ b/lib/Rewrite/HTMLRewrite.cpp @@ -50,6 +50,8 @@ static void AddLineNumber(Rewriter& R, unsigned LineNo, SourceLocation B, SourceLocation E) { // Surround the line text with a div tag. + + R.InsertCStrBefore(E, "</div>"); if (B == E) // Handle empty lines. R.InsertCStrBefore(B, "<div class=\"lines\"> </div>"); @@ -68,7 +70,7 @@ static void AddLineNumber(Rewriter& R, unsigned LineNo, // Now surround the whole line with another div tag. R.InsertCStrBefore(B, "<div class=\"codeline\">"); - R.InsertCStrAfter(E, "</div>"); + } void html::AddLineNumbers(Rewriter& R, unsigned FileID) { @@ -141,9 +143,12 @@ void html::AddHeaderFooterInternalBuiltinCSS(Rewriter& R, unsigned FileID) { << " .nums, .lines { float:left; height:100% }\n" << " .nums { background-color: #eeeeee }\n" << " .nums { font-size:smaller }\n" - << " .nums { width:2.5em; padding-right:2ex; text-align:right }\n" + << " .nums { width:2.5em; padding-right:2ex; text-align:right }\n" << " .lines { padding-left: 1ex; border-left: 3px solid #ccc }\n" << " .lines { white-space: pre }\n" + << " .msg { background-color:#fcff4c; float:left }\n" + << " .msg { font-family:Helvetica, sans-serif; font-size: smaller }\n" + << " .msg { padding:5px; margin-top:10px; margin-bottom:10px }\n" << " </style>\n" << "</head>\n" << "<body>"; |