quill-markdown-shortcuts icon indicating copy to clipboard operation
quill-markdown-shortcuts copied to clipboard

feat: Add ability to ignore elements

Open stoesky opened this issue 6 years ago • 1 comments

Hi @patleeman , first off - thank you for the great work! We're using this module for our web-app editor, and it works well.

One of the features we need for our comment section is to disallow certain elements such as headers + dividers (hr). In this pull request, I added a simple option (ignore = []) that will allow the ignoring of elements during auto-formatting.

Let me know your thoughts or feedback/issues with the submitted code. Thanks!

stoesky avatar Apr 02 '20 02:04 stoesky

@wooolfgang I just wanted to create a same PR ;) Thanks a lot.

@patleeman will you merge and release? Are you active on a project or should we fork?

I love the plugin but now we face an annoying case when you type:

The variable_name is a snakecase, which means you type_underscore

Which makes

The variable name is a snakecase, which means you type underscore

Or lets just fix this regexp https://github.com/patleeman/quill-markdown-shortcuts/blob/master/src/index.js#L118

so it should include whitespace (or be at the beginning of the line) before first underscore. And same logic with last

Same issue with bold

We fixed the issue in our repo https://github.com/devforth/quill-markdown-shortcuts (npm i -S @devforth/quill-markdown-shortcuts)

ivictbor avatar Jan 26 '21 21:01 ivictbor