MCPcopy Create free account
hub / github.com/Squirrel/Squirrel.Windows / EncodeCodeEvaluator

Method EncodeCodeEvaluator

src/Squirrel/MarkdownSharp.cs:1573–1590  ·  view source on GitHub ↗
(Match match)

Source from the content-addressed store, hash-verified

1571 return _codeEncoder.Replace(code, EncodeCodeEvaluator);
1572 }
1573 private string EncodeCodeEvaluator(Match match)
1574 {
1575 switch (match.Value)
1576 {
1577 // Encode all ampersands; HTML entities are not
1578 // entities within a Markdown code span.
1579 case "&":
1580 return "&";
1581 // Do the angle bracket song and dance
1582 case "<":
1583 return "&lt;";
1584 case ">":
1585 return "&gt;";
1586 // escape characters that are magic in Markdown
1587 default:
1588 return _escapeTable[match.Value];
1589 }
1590 }
1591
1592
1593 private static Regex _amps = new Regex(@"&(?!((#[0-9]+)|(#[xX][a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9]*));)", RegexOptions.ExplicitCapture | RegexOptions.Compiled);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected