-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
HTML entities in wikilinks #105
Comments
@jgm I don't mean to stress you, but having seen your prompt replies in other issues, I thought you might have missed this one. I'll be happy to create a PR once it is clear what the expected behavior is. |
I haven't had time to look into this. |
Thanks for your reply! I've tried it and unfortunately there is no standard. GitHub and Notable recognize the entities both in the wikilink description and target, but on the other hand Obsidian behaves like commonmark-hs (and so does pandoc, which you probably already know). In my opinion the entities should be recognized (because this behavior is consistent with the commonmark specification and I believe it usually is what the user intends), but I understand this may be controversial. I would be interested to hear the arguments supporting the current behavior. Of course there is no rush. I fully understand you may be short on time. |
I tried it out on MediaWiki (which powers Wikipedia) and it also recognizes HTML entities in wikilinks (in both the title and the reference). You can try this out by opening the editor on any Wikipedia page. I think it makes more sense to support entities in wikilinks. Given that ordinary links already recognize them, I find it surprising that wikilinks don't. Users can still type out |
I think I'd be fine with this change. @kukimik Did you want to make a PR? |
Yes, I'll do it, probably next week. |
The HTML entities are not recognized in wikilinks:
results in
Compare this to ordinary links
Is this behaviour of wikilinks intentional or a bug? If it is intentional, what are the arguments that support it? It seems to be against the commonmark rules regarding entities.
If it is intentional, I believe some explanation should be included in the test files:
https://github.com/jgm/commonmark-hs/blob/master/commonmark-extensions/test/wikilinks_title_after_pipe.md
https://github.com/jgm/commonmark-hs/blob/master/commonmark-extensions/test/wikilinks_title_before_pipe.md
If it is a bug, then I think changing
untokenize
toCommonmark.Entity.unEntity
inCommonmark.Extensions.Wikilinks.wikilinksSpec
should be enough to fix it? (And of course new test cases should also be included.)The text was updated successfully, but these errors were encountered: