Skip to content

enh(parser) simplify nohighlight#2374

Merged
joshgoebel merged 11 commits intohighlightjs:masterfrom
joshgoebel:no_highlight_regex
Feb 6, 2020
Merged

enh(parser) simplify nohighlight#2374
joshgoebel merged 11 commits intohighlightjs:masterfrom
joshgoebel:no_highlight_regex

Conversation

@joshgoebel
Copy link
Member

No description provided.

- Now only `no-highlight` and `nohighlight` skip a block entirely
- `plain` will do nothing
- `text` is now an alias for `plaintext`

Closes highlightjs#2363.
@joshgoebel joshgoebel added enhancement An enhancement or new feature parser labels Jan 31, 2020
@joshgoebel joshgoebel requested a review from egor-rogov January 31, 2020 14:56
@joshgoebel
Copy link
Member Author

@egor Any ideas on betting naming for languagePrefixRe? And should we perhaps remove the need to include the word at the end? (hence it truly being prefix) or should we leave it super flexible?

I decided to make both configurable while I was in there since it was easy and it's come up in conversation before.

@joshgoebel
Copy link
Member Author

joshgoebel commented Jan 31, 2020

I hadn't considered uses like (from the removed tests):

<pre><code class="text-content javascript">var x = 'foo';</code></pre>
<pre><code class="clipboard-text javascript">var x = 'foo';</code></pre>

But think it's still safe to consider them deprecated for the brutal consistency of "nohighlight". And if anyone is seriously affected they can just use the configuration option.

@joshgoebel joshgoebel added this to the 10.0 milestone Jan 31, 2020
@joshgoebel joshgoebel changed the title simplify nohighlight enh(parser) simplify nohighlight Feb 2, 2020
@joshgoebel joshgoebel merged commit 3bb179c into highlightjs:master Feb 6, 2020
taufik-nurrohman pushed a commit to taufik-nurrohman/highlight.js that referenced this pull request Feb 18, 2020
* (chore) make `noHighlightRe` and `languagePrefixRe` configurable (languageDetectRe now)
* (chore) simply 'nohighlight' regex

- Now only `no-highlight` and `nohighlight` skip a block entirely
- `plain` will do nothing
- `text` is now an alias for `plaintext`

Closes highlightjs#2363.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An enhancement or new feature parser

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants