mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
[PR #301] [MERGED] Improved emphasis parser #927
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/xoofx/markdig/pull/301
Author: @MihaZupan
Created: 1/29/2019
Status: ✅ Merged
Merged: 2/9/2019
Merged by: @xoofx
Base:
master← Head:improved-emphasis-parser📝 Commits (8)
6b1b516Add HasFlag enum support1b5d9d4Emit correct warning message in testsd232e84Allow different min/max emphasis delimiter counts42b201dUpdate internals to renewed Emphasis parser5266ae9Add extended emphasis tests035ce17Add generic TEnum constraint to HasFlag20bd561Avoid a possible Null Reference Ex.6488315Remove HasFlag helper📊 Changes
17 files changed (+328 additions, -145 deletions)
View changed files
📝
src/Markdig.Tests/Markdig.Tests.csproj(+1 -0)➕
src/Markdig.Tests/TestEmphasisExtended.cs(+168 -0)📝
src/Markdig.Tests/TestEmphasisPlus.cs(+1 -3)📝
src/Markdig.Tests/TextAssert.cs(+2 -2)📝
src/Markdig/Extensions/Citations/CitationExtension.cs(+6 -5)📝
src/Markdig/Extensions/CustomContainers/CustomContainerExtension.cs(+13 -15)📝
src/Markdig/Extensions/CustomContainers/HtmlCustomContainerInlineRenderer.cs(+1 -1)📝
src/Markdig/Extensions/EmphasisExtras/EmphasisExtraExtension.cs(+7 -6)📝
src/Markdig/Extensions/SmartyPants/SmartyPantsInlineParser.cs(+7 -7)📝
src/Markdig/Helpers/CharHelper.cs(+2 -6)📝
src/Markdig/Markdig.csproj(+1 -0)📝
src/Markdig/Parsers/Inlines/EmphasisDescriptor.cs(+1 -2)📝
src/Markdig/Parsers/Inlines/EmphasisInlineParser.cs(+80 -86)📝
src/Markdig/Renderers/Html/Inlines/EmphasisInlineRenderer.cs(+5 -3)📝
src/Markdig/Renderers/Normalize/Inlines/EmphasisInlineRenderer.cs(+2 -2)📝
src/Markdig/Syntax/Inlines/EmphasisDelimiterInline.cs(+16 -4)📝
src/Markdig/Syntax/Inlines/EmphasisInline.cs(+15 -3)📄 Description
This allows for emphasis parsing with min/max above 2 characters.
I marked
IsDoubleonEmphasisInlineas Obsolete as described below. This should not be a breaking change for existing parsers/renderers.d232e847dd/src/Markdig/Syntax/Inlines/EmphasisInline.cs (L24-L36)I also changed the way adding a
CreateEmphasisInlineworks (since there can no longer be abool isStrongidentifier), so now there's no need to save the previous one, attempt the new one and revert to the old one on callsites, instead adding the delegate to the list, returning null if not providing an emphasis.CreateEmphasisInlineDelegateis marked as obsolete in favour ofTryCreateEmphasisInlineDelegate. Note that this shouldn't be a breaking change, since for now the parser will attempt to use the old delegate first.42b201d8c2/src/Markdig/Extensions/CustomContainers/CustomContainerExtension.cs (L29-L36)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.