Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dear Alexis
I would like to use your excellent racket-commonmark library to parse and process notes taken with Obsidian. Obsidian generates CommonMark, with some custom syntax. Most importantly, Obsidian makes heavy use of WikiLinks, such as
[[link]]
and[[link|link with custom label]]
.The commit in this pull request introduces
current-parse-wikilinks?
, a parameter to enable the parsing of WikiLinks (with default value#f
), andwikilink
, a struct corresponding to the new WikiLink inline content type.I am not aware of a formal definition of WikiLinks, and parsing of WikiLinks differs substantially across implementations. Here, I have attempted to follow the behavior of MediaWiki, arguably the most widely-used wiki engine. (See, for example, the note on nested WikiLinks in
inline.rkt
.)Importantly, enabling WikiLink parsing breaks conformance with the CommonMark spec! The following four conformance tests for CommonMark 0.30 fail when WikiLink parsing is enabled:
![[[foo](uri1)](uri2)](uri3)\n
[[[foo]]]\n\n[[[foo]]]: /url\n
[[*foo* bar]]\n\n[*foo* bar]: /url \"title\"\n
![[foo]]\n\n[[foo]]: /url \"title\"\n
Thus, I fully understand if you're not interested in this pull request.