Skip to content
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

Link concealing [feature request] #108

Closed
Ginner opened this issue May 22, 2020 · 4 comments
Closed

Link concealing [feature request] #108

Ginner opened this issue May 22, 2020 · 4 comments
Assignees
Labels
feature:request Requesting new and additions to existing features.

Comments

@Ginner
Copy link
Contributor

Ginner commented May 22, 2020

Hi Sidney!

First off, thank you for a great plugin. I've been using it for a little while.
In the documentation it says that it is not a 'syntax plugin', so I've been using the, also great, vim-pandoc-syntax as a stand-alone syntax plugin.

However, it seems that your plugin is actually a pretty good syntax-plugin as well. The only thing I'm missing after turning off vim-pandoc-syntax is concealing urls. E.g.:
[something](long-url-to-something.com) becomes something (but underlined).

I'd love to see it implemented. What are your thoughts on that?

Again, thank you.

@Ginner Ginner changed the title Link concealing Link concealing [feature request] May 22, 2020
@SidOfc
Copy link
Owner

SidOfc commented May 22, 2020

Hey @Ginner!

I remember you also sent a PR to fix a typo in the README, glad to see you're happy still :)
As for mkdx not being a syntax plugin, indeed I did not intend for it to be one so even to this day, it only "appends" syntax so that it can be used with an existing markdown highlighter (mainly the default one, but other syntax-only markdown plugins should work as well).

Even the appended syntax isn't written by me but mostly copied over from people who understand far more about how to do these kinds of things (though I do patch / tweak some small things sometimes). That said I don't think it would hurt to add this as an "opt-in" feature.

That means I would add a new setting to mkdx which would allow you to conceal links. For inspiration I could look at what vim-pandoc-syntax does and perhaps copy it into the syntax file + give them credits for actually writing it.

I'll have to do some research to see if it would break other features (since now you can remove links by pressing prefixln which relies on syntax highlighting).

I'll look into it, thanks for the suggestion 👍

@SidOfc SidOfc self-assigned this May 22, 2020
@SidOfc SidOfc added the feature:request Requesting new and additions to existing features. label May 22, 2020
SidOfc added a commit that referenced this issue May 22, 2020
Conceal link URLs when &conceallevel is set (#108)
@SidOfc
Copy link
Owner

SidOfc commented May 22, 2020

Hi @Ginner,

Worked on it a little bit, I doubt a flag will even be needed because if a user actually sets conceallevel it means they likely want to just conceal the text anyway. I'd love to hear any thoughts about wether mkdx should allow this being optional even when conceallevel is set though, feel free to comment.

Also, you mentioned it just showing the text, does that mean vim-pandoc-syntax also hides the surrounding [ and ] marks?

In any case it's in master and you can give it a try to see if it works correctly for you :)

@Ginner
Copy link
Contributor Author

Ginner commented May 22, 2020

Wow, you're effective!

I think you're right in your assumption, that users enabling concealment will want the feature on. At least I do ;)

No, you're right, vim-pandoc-syntax leaves the square brackets, which I find preferable. sorry for that.

I've tried it and it works perfectly! Thank you so much :)

@SidOfc
Copy link
Owner

SidOfc commented May 22, 2020

Haha cheers for the compliment :)

And no problem either, good to know vim-pandoc-syntax leaves them too :)
Should issues pop up with it feel free to reopen!

In the meantime, enjoy the feature, and closing :)

@SidOfc SidOfc closed this as completed May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:request Requesting new and additions to existing features.
Projects
None yet
Development

No branches or pull requests

2 participants