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
ReferenceError: navigator is not defined
using Markdown plugin API in node.js
#3517
Comments
If we use the import Reveal from 'reveal.js/dist/reveal.esm.js';
import Markdown from 'reveal.js/plugin/markdown/markdown.esm.js';
Reveal.initialize({ plugins: [Markdown, Highlight] });
|
@t-fritsch This issue has been opened due to a breaking change in the Markdown plugin going from 4.5.0 to 4.6.1 as mentioned here: webpro/reveal-md#462 . This plugin is used in Reveal-md. The call to the Markdown plugin happens at https://github.com/webpro/reveal-md/blob/be9dd1154e3e270c1e6b699c52901982d37a822b/lib/util.js#L15 , but due to the adding of this line in Reveal.js: 31174cb#diff-798667ccd1007ded74fcdc410627add5ca0946dd54e4b5e0a22a5559900fb97aR98 , we cannot use the call to the plugin no more as |
Hey, thank you for the clarification, I didn't understand the issue at first. Achieving the same functionality without accessing Anyway, imho this issue isn't really an issue of Reveal itself : I may be wrong but it never was intented to run server-side. Having a great tool like reveal-md using reveal.js is really cool but I wonder if this kind of issue shouldn't be adressed in their repo since it's using Reveal in a way that is not the "usual" one. |
@hakimel could you tell if this issue should be reopened or not ? |
@t-fritsch Maybe the plugin could be changed a little bit to only use the user options if getConfig is defined? |
I've added a nil check so the |
I think import Markdown from 'reveal.js/plugin/markdown/markdown.js';
export const md = (() => {
return Markdown();
})();
|
@MartenBE Got it—I've added a check for that too and confirmed that this works: const md = RevealMarkdown();
md.slidify('# Slide 1\n---\n#Slide 2') |
Thank you very much! We'll upgrade our dependency at your next release. We'll also investigate if we can let go of the direct call in the future. |
When executing the following code in a node.js application:
We get the following error:
We would like to call the slidify function from the Markdown plugin manually. How do we best go about it?
The text was updated successfully, but these errors were encountered: