mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-23 11:16:59 -04:00
[HTML] Fix weird inline code block behavior with two backticks
This commit is contained in:
parent
8685a3d7e3
commit
2a02894d64
1 changed files with 2 additions and 2 deletions
|
@ -84,8 +84,8 @@ namespace DiscordChatExporter.Domain.Markdown
|
||||||
// Blank lines at the beginning and end of content are trimmed
|
// Blank lines at the beginning and end of content are trimmed
|
||||||
// There can be either one or two backticks, but equal number on both sides
|
// There can be either one or two backticks, but equal number on both sides
|
||||||
private static readonly IMatcher<MarkdownNode> InlineCodeBlockNodeMatcher = new RegexMatcher<MarkdownNode>(
|
private static readonly IMatcher<MarkdownNode> InlineCodeBlockNodeMatcher = new RegexMatcher<MarkdownNode>(
|
||||||
new Regex("`([^`]+)`", DefaultRegexOptions | RegexOptions.Singleline),
|
new Regex("(`{1,2})([^`]+)\\1", DefaultRegexOptions | RegexOptions.Singleline),
|
||||||
m => new InlineCodeBlockNode(m.Groups[1].Value.Trim('\r', '\n')));
|
m => new InlineCodeBlockNode(m.Groups[2].Value.Trim('\r', '\n')));
|
||||||
|
|
||||||
// Capture language identifier and then any character until the earliest triple backtick
|
// Capture language identifier and then any character until the earliest triple backtick
|
||||||
// Language identifier is one word immediately after opening backticks, followed immediately by newline
|
// Language identifier is one word immediately after opening backticks, followed immediately by newline
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue