mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-04 05:44:50 +00:00
How to make bold just a part of a word? #653
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?
Originally created by @ghost on GitHub (Jan 31, 2024).
I have a string that needs to be transformed into HTML format.
非常抱歉,{{coachname}}无法再在**{{sessiondate}}**的**{{sessiontime}} {{sessiontimezone}}**进行您即将参加的教练谈话。The result of Markdig
Markdig.Markdown.ToHtmlis非常抱歉,{{coachname}}无法再在**{{sessiondate}}<strong>的</strong>{{sessiontime}} {{sessiontimezone}}**进行您即将参加的教练谈话。Some of the (** ) were converted to HTML, while others were not.
I guess the problem is with spaces. Ideally, Markdig expects something like hello but not hello.
What is the appropriate way to handle such a string that I have above?


More examples:
where:
value - is the original string that should be converted.
markdig - the result of Markdig package work
markdown - the result of the legacy Markdown package
@xoofx commented on GitHub (Jan 31, 2024):
Similar issue to https://github.com/xoofx/markdig/issues/765#issuecomment-1914833501
在**{{sessiondate}}**的cannot work because{or}is a punctuation character, so you have to put a space before (for the opening) or after (for the closing so that在 **{{sessiondate}}** 的would render properly 在 {{sessiondate}} 的See babelmark here and you can verify that all CommonMark implementations behave the same here.
It is normal that you will get lots of error when converting from
markdown - the result of the legacy Markdown packageto CommonMark, but it will be unlikely an issue with Markdig, but more something that you will have to change in these templates to comply with CommonMark.