-
Notifications
You must be signed in to change notification settings - Fork 642
Support angle bracket escaped markdown urls #1211
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
Support angle bracket escaped markdown urls #1211
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please copy-paste a snippet of what you see before and after the changes.
Also note the hardcoded regex because this may break some user configuration.
A link to that markdown spec in comment would be nice (easier to verify).
That said, the improvement seems nice, thank you for the effort. With small changes to get it safe, sure it will be accetpted.
let valid_chars_url = '[^[:cntrl:]]'
let mkd_syntax.rxWeblink1Prefix = vimwiki#u#escape(mkd_syntax.rxWeblink1Prefix)
let mkd_syntax.rxWeblink1Separator = vimwiki#u#escape(mkd_syntax.rxWeblink1Separator)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is hardcoded => bad
Please better change the default data in vars.vim
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would something like let mkd_syntax.rxWeblink1Separator = vimwiki#u#escape(mkd_syntax.rxWeblink1Separator).'<\='
be preferable or should I pull this into a new variable entirely? I'm not sure how to escape it without ruining the \=
let valid_chars_url = '[^[:cntrl:]]' | ||
|
||
let mkd_syntax.rxWeblink1Prefix = vimwiki#u#escape(mkd_syntax.rxWeblink1Prefix) | ||
let mkd_syntax.rxWeblink1Separator = vimwiki#u#escape(mkd_syntax.rxWeblink1Separator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is hardcoded => bad
Please better change the default data in vars.vim
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would something like let mkd_syntax.rxWeblink1Separator = vimwiki#u#escape(mkd_syntax.rxWeblink1Separator).'<\='
be preferable or should I pull this into a new variable entirely? I'm not sure how to escape it without ruining the \=
Visually there will be no change, markdown-style links will be concealed the same way. I should have mentioned that this allows
Pandoc doesn't mention it in the docs but it's in the code if that helps. Thanks! I will fix up the regex shortly. |
@CharlesSchimmel @tinmarino this is exactly what I want. Anything I can help with? I'd like to get this PR merged. |
I was coming to check if just this feat had been discussed before to work on it and make a PR. I'm glad to see that someone has already worked on it. I would like to see this PR merge! |
Rebased with squashed <= It works fine actually I am really sorry for the delay, got confused => Was waiting for @CharlesSchimmel who was actually waiting for my answer. Sorry guys. And well thank you very much @CharlesSchimmel for the PR (and the patience). I hope to see you in another PR 😃 |
Very small change to support Markdown links with angle bracket escaped URIs, like
[link title](<path/to/some file>)
to enable link-following of angle bracket escaped markdown links. This syntax is part of the the Commonmark spec:This is also helpful is people use Obsidian alongside their Vimwiki as Obsidian strongly conforms to markdown standards and will not parse links with enescaped spaces. I believe this is all needed to support link following and concealment/preview.
dev
branch!doc/vimwiki.txt
if applicable,including the Changelog and Contributors sections.
Edited to specifically highlight link-following of angle bracket escaped markdown links and add related commonmark spec