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

Command Line plugin not escaping output HTML #3340

Closed
at055612 opened this issue Feb 16, 2022 · 0 comments · Fixed by #3341
Closed

Command Line plugin not escaping output HTML #3340

at055612 opened this issue Feb 16, 2022 · 0 comments · Fixed by #3341

Comments

@at055612
Copy link
Contributor

Information:

  • Prism version: 13b56a9
  • Plugins: Command Line
  • Environment: Browser

Description
If the command output includes html reserved characters, they are not escaped and thus are treated as HTML.
This is because the command output is not subject to highlighting and thus does not get escaped by Prism.js.

I have a fix. Will submit a PR shortly.

Example
If you have this HTML

<pre class="command-line" data-filter-output="(out)"><code class="language-bash">
echo '&lt;span style=&quot;font-size: 2em&quot;&gt;foobar&lt;/span&gt;'
(out)&lt;span style=&quot;font-size: 2em&quot;&gt;foobar&lt;/span&gt;
</code></pre>

Then you get this output

image

But what we want is:

image

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

Successfully merging a pull request may close this issue.

3 participants
@RunDevelopment @at055612 and others