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

Unscaped Markup #1197

Closed
LostInBrittany opened this issue Sep 29, 2017 · 1 comment
Closed

Unscaped Markup #1197

LostInBrittany opened this issue Sep 29, 2017 · 1 comment

Comments

@LostInBrittany
Copy link

Hi!

It's my first time posting an issue at Prism, I am not sure about the etiquette, so please excuse me if it don't fit :)

It seems there is a small problem in the Unescaped Markup doc.

It says that you can simply use <script type="text/plain"> instead of using <pre><code> elements. I tried, it didn't work, so I looked at the code and I saw the plugin added some new selectors:

	Prism.hooks.add('before-highlightall', function (env) { 
		env.selector += ", .lang-markup script[type='text/plain'], .language-markup script[type='text/plain']" +
		                ", script[type='text/plain'].lang-markup, script[type='text/plain'].language-markup";  
	});

So it seems that <script type="text/plain"> won't work, that you need either <sometag class="lang-markup"><script type="text/plain">, <sometag class="language-markup"><script type="text/plain">,
<script type="text/plain" class="lang-markup"> or <script type="text/plain" class="language-markup">

I tested with them and it worked.

I was going to do a PR for this, but before I'd like to know which is the intended behavior, the one described in the doc (without added CSS classes) or the one in the code.

Thanks!

@Golmote
Copy link
Contributor

Golmote commented Sep 29, 2017

Hi! The expected behaviour is the one in the code. The doc might need so clarification indeed.

@Golmote Golmote closed this as completed in 924784a Dec 5, 2017
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