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

How to set precedence for nested markdown shortcuts? #33

Open
amit1rrr opened this issue Jan 29, 2020 · 3 comments
Open

How to set precedence for nested markdown shortcuts? #33

amit1rrr opened this issue Jan 29, 2020 · 3 comments

Comments

@amit1rrr
Copy link

First of all, thank you @patleeman and all other contributors for an amazing Quill module. This was literally drop in for something that I considered would take me a week or more to support at ReviewNB.

One of the issues we are facing is how to set precedence when there are nested markdown shortcuts used? E.g. when people type [x for x in my_long_list_of_params] the underscores take precedence over backticks. This results in unintended formatting.

Is there configuration of some sort which would help us set precedence for markdown shortcuts?

@amit1rrr
Copy link
Author

So the issue turned out to be broad regex for italics which I have modified in my fork.

The problem with the previous regex is that it captures any 2 underscores and converts the text between them to italics. e.g. my_local_var would convert local to italics. IMHO that is not how markdown intended it to be. The word should only become italics when starts and ends with underscore and there is no whitespace character immediately before or after the underscores.

Anyway my regex fixes the issue and is working fine for me.

I have created a PR here: #34

Hope someone can review this.

@philiprenich
Copy link

I've left a comment on this.

Also, for reference, here are the docs on how to handle examples like my_local_var - use * for formatting, not _. That sounds like a different/more complicated regex :/

@philiprenich
Copy link

ps @amit1rrr as someone who just found this module, I'm excited to see that there are people actively working to make it better! I'm hoping to start using it and contributing back as well if I find any issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants