Beispiel #1
0
 static string UnFormat(string theInput) {
     var result = new TextOutput(IsStandard);
     var scan = new Scanner(theInput);
     while (true) {
         scan.FindTokenPair("<", ">", ourValidTagFilter);
         result.Append(scan.Leader);
         if (scan.Body.IsEmpty) break;
         if (IsStandard) result.AppendTag(GetTag(scan.Body));
     }
     return result.ToString();
 }
Beispiel #2
0
 static string UnEscape(string theInput) {
     var scan = new Scanner(theInput);
     var result = new StringBuilder();
     while (true) {
         scan.FindTokenPair("&", ";");
         result.Append(scan.Leader);
         if (scan.Body.IsEmpty) break;
         if (scan.Body.Equals("lt")) result.Append('<');
         else if (scan.Body.Equals("gt")) result.Append('>');
         else if (scan.Body.Equals("amp")) result.Append('&');
         else if (scan.Body.Equals("nbsp")) result.Append(' ');
         else if (scan.Body.Equals("quot")) result.Append('"');
         else {
             result.Append('&');
             result.Append(scan.Body);
             result.Append(';');
         }
     }
     return result.ToString();
 }
Beispiel #3
0
 public void Input(string theInput) {
     myScanner = new Scanner(theInput);
 }
Beispiel #4
0
 static string AddStyleSheetLink(string input) {
     var scanner = new Scanner(input);
     while (true) {
         scanner.FindTokenPair("<link", ">");
         if (scanner.Body.IsEmpty) break;
         if (scanner.Body.Contains("fit.css")) return input;
     }
     return styleSheetLink + input;
 }