-
Notifications
You must be signed in to change notification settings - Fork 50
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
Javascript references in code blocks break presentation #51
Comments
I think this problem is not exactly due to Perhaps |
Ok, I figured out what the problem was. Apparently, you cannot have the sequence of chars In other words, this is not valid HTML: <html>
<head></head>
<body>
<script>
var v = "</script>";
</script>
</body>
</html> A workaround for this problem is to "break" the conflictive sequence of chars. For example: <script>
var v = "<" + "/script>";
</script> This way the variable I think this approach can be easily used in backslide. I'm preparing a PR. |
Sorry for the delay, a fix is already present in the You can use it in the meantime by cloning this repo, then:
|
Fixed in |
OS
MacOS Mojave, 10.14.2
Problem
When one document contains code blocks in html which contain
<script>
tags, the presentation cannot be visualized.The following
presentation.md
Results in a
presentation.html
afterbs export --no-inline
, which contains:It looks correct, but the browser (Chrome) complains about
presentation.html:27 Uncaught SyntaxError: Invalid or unexpected token
(line 27 is the one containingsource: "..."
). I noticed also that all editors I tried on this file (vim, VS Code), also produced bad syntax highlighting on that line and a warning about "unterminated string literal", but I'm unable to see what is wrong.Apparently, the browser considers the
</script>
inside thesource
attribute as the closing tag for<script>function create()...
As a result,create()
is not properly defined and the presentation looks like this:Expected Result
A presentation showing the example code.
As a workaround I can change
<script></script>
in the example by something which looks similar, for example<scipt></scipt>
, or, being mischievous<sсript></sсript>
in which I replaced ASCIIc
by cyrillic small letter esс
(U+0411) which looks identical.This makes the problem vanish. The resulting
presentation.html
contains now (afterbs export --no-inline
):Which even if it looks indentical to the first case, (but with the
c
replaced by cyrillic) it does not produce any error in the browser nor the editors tried. The resulting page now renders fine:The text was updated successfully, but these errors were encountered: