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

Cannot use span tag in "code" tag any more #3508

Closed
MagicJack opened this issue Mar 23, 2022 · 1 comment
Closed

Cannot use span tag in "code" tag any more #3508

MagicJack opened this issue Mar 23, 2022 · 1 comment
Labels
bug help welcome Could use help from community parser

Comments

@MagicJack
Copy link

MagicJack commented Mar 23, 2022

Describe the issue/behavior that seems buggy
Up to ver.10.3.7 I can add some customization tags between <code> and </code>. But this feature seems to be removed in version 11.

Sample Code or Instructions to Reproduce

<div class="code">
<pre><code class="plaintext">&gt; <span style='color:orange'>install.packages('IRkernel')</span>
</code></pre>
</div>

the related script and style and activation are below.

<link href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.0/styles/tomorrow-night-bright.min.css" rel="stylesheet" />
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.0/highlight.min.js" type="text/javascript"></script>
<script>hljs.highlightAll();</script>

Expected behavior
The color of text install.packages('IRkernel') is orange

Additional context
Is this feature removed? or is there other method instead of just using hljs.hilightAll()

@MagicJack MagicJack added bug help welcome Could use help from community parser labels Mar 23, 2022
@joshgoebel
Copy link
Member

joshgoebel commented Mar 23, 2022

This change of behavior was very intentional - and there is no way to do this anymore with only the core library.

Context: #2889

This functionality could be added back via plugin if anyone wanted to maintain the code, but so far no one has stepped up to the plate to do so.

plaintext

If all you care about is plaintext then see the README for how to ask Highlight.js to ignore that block entirely, in which case the HTML you're using will "just work" since it's just HTML - there is no need for this to be processed by Highlight.js at all. Though for styling reasons you may still want to add the hljs class for visual consistency with other code blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help welcome Could use help from community parser
Projects
None yet
Development

No branches or pull requests

2 participants