-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn about incomplete symbol links (
Link
` )
#165
Comments
Link
)Link
</code>)
Link
</code>)\
Link\`)
\
Link\`)Link\
)
Link\
)
Link
``)
Link
``)
Link
`)
Link
`)
Link
` )
It looks like this is down to behavior in swift-cmark; the upstream CommonMark/GitHub-Flavored Markdown spec says that mismatched delimiters are emitted literally:
It might be possible to add an optional flag to swift-cmark that enables some more permissive parsing behavior, but this would break compatibility with CommonMark and GitHub-Flavored Markdown. |
Does Markdown have a mechanism for emitting warnings? If so, it could continue to emit the parsed content according to the spec but also give callers an indication of potential syntax issues. |
It does not; the parsing philosophy in Markdown is to be maximally permissive and always fall back to emitting the text as given. GFM (like CommonMark before it) does not emit any warnings about content whatsoever. |
It's easy to make a typo when writing symbol links and close the link with only a single backtick (
`
). For example,The example markup above parses as a single text element, making it hard for other tools that use Swift Markdown to diagnose the issue.
For comparison, if the same markup was written like
``Link``
or
then it parses as 3 distinct elements.Link
or
The text was updated successfully, but these errors were encountered: