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

Content of <script> tags is escaped when they are inside html tags and 'sanitize: false' #257

Closed
andreyvolokitin opened this issue Oct 6, 2013 · 3 comments · Fixed by #1135

Comments

@andreyvolokitin
Copy link

If for example we have this html in our markdown:

<div>
    <script>if (5 > 4) {}</script>
</div>

then content of <script> will be escaped. But content remains unescaped if <script> is not surrounded with html:

<script>if (5 > 4) {}</script>

If here we just set pre: true then content of <script> within html will not be escaped as expected. Is it a bug or a feature, and how can I force marked.js to not escape content of <script> within html?

@timoxley
Copy link

👍

@pixelkritzel
Copy link

+1

I'm using marked as part of an styleguide generator and need to embed script tags in HTML. Is there an option to deactivate this kind of behaviour?

@pixelkritzel
Copy link

And hopefully I found a solution for my case. I have to see, if there will be some unforseen consequences. But I set the pedantic option to true.

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

Successfully merging a pull request may close this issue.

3 participants