Handle text escaping (e.g. & -> &) last, to avoid interactions between 'replace' operations and insert operations.  This fixes a problem with "&;&" on line 666 of the gcc.c example I sent out.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49874 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/HTMLPrint.cpp b/Driver/HTMLPrint.cpp
index 54678de..ff04b0e 100644
--- a/Driver/HTMLPrint.cpp
+++ b/Driver/HTMLPrint.cpp
@@ -55,7 +55,6 @@
 
   // Format the file.
   unsigned FileID = R.getSourceMgr().getMainFileID();
-  html::EscapeText(R, FileID, false, true);
   html::AddLineNumbers(R, FileID);
   html::AddHeaderFooterInternalBuiltinCSS(R, FileID);
 
@@ -67,6 +66,7 @@
     html::SyntaxHighlight(R, FileID, *PP);
     html::HighlightMacros(R, FileID, *PP);
   }
+  html::EscapeText(R, FileID, false, true);
   
   
   // Open the output.