Question

I'm creating a blog using node.js and I'm still debating whether I'm going to use PageDown or stick to whatever I have at the moment.

The current Markdown editor that I have its allow the user to enter any code they want without any restriction and some people think that it is a bad idea to do so, but having that option enabled by default for my blog it is okay because its a single author blog, and the owner obviously would be the advance users.

I have come across an awesome editor like PageDown and now I really want to know if I can use some hook or some thing that I can disable the sanitizer so that if they want to insert some code in their blog post so they can do it as well.

Such as :

<video class="inline-content centered" src="http://people.mozilla.org/~rgiles/2013/khuey-cycle_collector-sd.webm" controls>
  <track src="/assets/captions/cycle-collector.vtt" kind="subtitles" default />
</video>

At least they should see the video embed or even any iframe.

I want the live preview to also display the code as well, but not sure what or how I can do that.

Était-ce utile?

La solution

To answer my own question:

I have found out that in PageDown we have an option to use the converter without sanitizing.

        var converter = new Markdown.Converter();
        var editor = new Markdown.Editor(converter);
        editor.run();
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top