Closed femtomc closed 1 year ago
If I literally just paste:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pseudocode@latest/build/pseudocode.min.css">
<script src="https://cdn.jsdelivr.net/npm/pseudocode@latest/build/pseudocode.min.js"></script>
<pre id="hello-world-code">
\begin{algorithmic}
\PRINT \texttt{'hello world'}
\end{algorithmic}
</pre>
<script>
pseudocode.renderElement(document.getElementById("hello-world-code"));
</script>
into an HTML file, I get the same error, unfortunately.
Hi @femtomc,
Thanks for reporting this. Seems like one of my recent changes is incompatible with an undefined options
parameter. Setting it to empty {}
works as expected. Please see https://jsfiddle.net/hy1sa537/
I am working on a fix right now.
Found the issue. It's this line:
introduced in 30f2576509167727ea3ff356ad2635e9df9505ce to allow per-element overriding of options.
JSON.parse
doesn't like empty strings :man_facepalming:
I'm trying to run the README example -- but I'm running into a
JSON.parse
error inrenderElement
:I'm building a static site through
quarto
andhugo
, and I've confirmed that my HTML output is what I expect -- specifically:gets inserted into my generated HTML (as I would expect). I also fetch
pseudocode.js
from CDN in header.Any mistake I've made standing out?