public override string ModifyLine(string line)
 {
     // Encode the contents of the "<pre>" tags so that we don't
     // generate formatting out of it.
     line = NoTextileEncoder.EncodeNoTextileZones(line,
                                                  @"(?<=(^|\s)<pre(" + TextileGlobals.HtmlAttributesPattern + @")>)",
                                                  @"(?=</pre>)");
     return(line);
 }
        internal static string InnerModifyLine(string line)
        {
            // Replace "@...@" zones with "<code>" tags.
            MatchEvaluator me = new MatchEvaluator(CodeFormatMatchEvaluator);

            line = CodeBlockRegex.Replace(line, me);

            // Encode the contents of the "<code>" tags so that we don't
            // generate formatting out of it.
            line = NoTextileEncoder.EncodeNoTextileZones(line,
                                                         @"(?<=(^|\s)<code(" + Globals.HtmlAttributesPattern + @")>)",
                                                         @"(?=</code>)");
            return(line);
        }
Пример #3
0
 public override string ModifyLine(string line)
 {
     // Replace "@...@" zones with "<code>" tags.
     MatchEvaluator me = new MatchEvaluator(CodeFormatMatchEvaluator);
     line = Regex.Replace(line,
                           @"(?<before>^|([\s\([{]))" +    // before
                            "@" +
                           @"(\|(?<lang>\w+)\|)?" +        // lang
                            "(?<code>[^@]+)" +              // code
                            "@" +
                           @"(?<after>$|([\]}])|(?=" + Globals.PunctuationPattern + @"{1,2}|\s|$))",  // after
                         me);
     // Encode the contents of the "<code>" tags so that we don't
     // generate formatting out of it.
     line = NoTextileEncoder.EncodeNoTextileZones(line,
                           @"(?<=(^|\s)<code(" + Globals.HtmlAttributesPattern + @")>)",
                           @"(?=</code>)");
     return line;
 }
 internal static string InnerModifyLine(string line)
 {
     line = NoTextileEncoder.EncodeNoTextileZones(line, @"(?<=^|\s)<notextile>", @"</notextile>(?=(\s|$)?)");
     line = NoTextileEncoder.EncodeNoTextileZones(line, @"==", @"==");
     return(line);
 }
 public override string ModifyLine(string line)
 {
     line = NoTextileEncoder.EncodeNoTextileZones(line, @"(?<=^|\s)<notextile>", @"</notextile>(?=(\s|$)?)");
     line = NoTextileEncoder.EncodeNoTextileZones(line, @"==", @"==");
     return(line);
 }