You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Background knowledge
Unix and DOS based systems use different line terminators:
Unix: \n (newline)
DOS: \r\n (carriage-return line-feed, CRLF)
Describe the bug
The regex used to identify markdown lists doesn't properly handle /r/n line terminations, causing unintended behavior in our flavored-markdown.
To Reproduce
I found this issue while working on Vantage Console in-product help, which utilizes Covalent markdown-navigator & flavored-markdown.
We want to display relative and external links within help .md files. However, the links in some files are not rendering as intended. (See screenshot below).
In other cases, both relative and external links are working fine:
The difference is caused by the line termination on these two files. The improper, first screenshot has only \n unix-style line terminators, while the properly displayed API guide has \r\n.
Looking at the code, the intention is for flavored-markdown to identify markdown lists and convert them to the cfm-list component. But, the cfm-list only displays the raw list item content; It doesn't identify and convert links to <a> tags.
When processing a markdown file with CRLF line termination, the regex used to identify markdown lists doesn't return any matches, so flavored-markdown doesn't convert markdown lists to the custom cfm-list component. Those links are rendered properly with the vanilla showdown link styling.
Expected behavior
flavored-markdown should accept markdown with either unix or dos style line termination, and should render links in lists properly
Suggested fix
Remove the cfm list entirely, and just use the default list built into showdown. Then all line termination styles will be properly rendered.
Alternatively, we could update the regex to match both \n and \r\n, and add logic to convert md links to <a> tags in the cfm-list component. This requires significantly more engineering effort.
@owilliams320@jeremysmartt is there a reason to keep the cfm-list component? Or can we remove and use the default showdown styling?
The text was updated successfully, but these errors were encountered:
Background knowledge
Unix and DOS based systems use different line terminators:
\n
(newline)\r\n
(carriage-return line-feed, CRLF)Describe the bug
The regex used to identify markdown lists doesn't properly handle
/r/n
line terminations, causing unintended behavior in our flavored-markdown.To Reproduce
I found this issue while working on Vantage Console in-product help, which utilizes Covalent markdown-navigator & flavored-markdown.
We want to display relative and external links within help
.md
files. However, the links in some files are not rendering as intended. (See screenshot below).In other cases, both relative and external links are working fine:

The difference is caused by the line termination on these two files. The improper, first screenshot has only
\n
unix-style line terminators, while the properly displayed API guide has\r\n
.Looking at the code, the intention is for flavored-markdown to identify markdown lists and convert them to the cfm-list component. But, the cfm-list only displays the raw list item content; It doesn't identify and convert links to
<a>
tags.When processing a markdown file with CRLF line termination, the regex used to identify markdown lists doesn't return any matches, so flavored-markdown doesn't convert markdown lists to the custom cfm-list component. Those links are rendered properly with the vanilla showdown link styling.
Expected behavior
flavored-markdown should accept markdown with either unix or dos style line termination, and should render links in lists properly
Suggested fix
Remove the cfm list entirely, and just use the default list built into
showdown
. Then all line termination styles will be properly rendered.Alternatively, we could update the regex to match both
\n
and\r\n
, and add logic to convert md links to<a>
tags in the cfm-list component. This requires significantly more engineering effort.@owilliams320 @jeremysmartt is there a reason to keep the cfm-list component? Or can we remove and use the default showdown styling?
The text was updated successfully, but these errors were encountered: