| @@ -390,11 +390,9 @@ namespace Docnet | |||||
| text = DoHeaders(text); | text = DoHeaders(text); | ||||
| text = DoHorizontalRules(text); | text = DoHorizontalRules(text); | ||||
| text = DoLists(text); | text = DoLists(text); | ||||
| text = DoAlertBlocks(text); | |||||
| text = DoGithubCodeBlocks(text); | text = DoGithubCodeBlocks(text); | ||||
| text = DoCodeBlocks(text); | text = DoCodeBlocks(text); | ||||
| text = DoBlockQuotes(text); | text = DoBlockQuotes(text); | ||||
| text = DoTabsBlocks(text); | |||||
| // We already ran HashHTMLBlocks() before, in Markdown(), but that | // We already ran HashHTMLBlocks() before, in Markdown(), but that | ||||
| // was to escape raw HTML in the original Markdown source. This time, | // was to escape raw HTML in the original Markdown source. This time, | ||||
| @@ -404,6 +402,8 @@ namespace Docnet | |||||
| text = FormParagraphs(text, unhash: unhash); | text = FormParagraphs(text, unhash: unhash); | ||||
| text = DoAlertBlocks(text); | |||||
| text = DoTabsBlocks(text); | |||||
| return text; | return text; | ||||
| } | } | ||||
| @@ -1760,7 +1760,8 @@ namespace Docnet | |||||
| return sb.ToString(); | return sb.ToString(); | ||||
| } | } | ||||
| private static Regex _codeEncoder = new Regex(@"&|<|>|\\|\*|_|\{|\}|\[|\]", RegexOptions.Compiled); | |||||
| // all characters you want to encode in a codeblock to this regexp. | |||||
| private static Regex _codeEncoder = new Regex(@"&|<|>|@|\\|\*|_|\{|\}|\[|\]", RegexOptions.Compiled); | |||||
| /// <summary> | /// <summary> | ||||
| /// Encode/escape certain Markdown characters inside code blocks and spans where they are literals | /// Encode/escape certain Markdown characters inside code blocks and spans where they are literals | ||||
| @@ -1782,6 +1783,8 @@ namespace Docnet | |||||
| return "<"; | return "<"; | ||||
| case ">": | case ">": | ||||
| return ">"; | return ">"; | ||||
| case "@": | |||||
| return "@"; // this is necessary so our extensions to markdown which start with @ are left alone in a code block. | |||||
| // escape characters that are magic in Markdown | // escape characters that are magic in Markdown | ||||
| default: | default: | ||||
| return _escapeTable[match.Value]; | return _escapeTable[match.Value]; | ||||