문제

I have an issue with using getSanitizingConverter().When I try to use the following code:

var plainText;
var markdown = new Markdown.Converter();
var markdown = getSanitizingConverter();

plainText = markdownConverter.makeHtml("#Hi");

$(".hello").html(plainText);

I get an error saying Uncaught ReferenceError: getSanitizingConverter is not defined

My HTML:

<script src="markdown/converter.js"></script>
<script src="markdown/sanitizer.js"></script>
<script src="main.js"></script>

What am I doing wrong?

Here is a codepen RTC

도움이 되었습니까?

해결책

It looks like the getSanitizingConverter function is placed on the Markdown variable. Try this:

var plainText;
var markdown = Markdown.getSanitizingConverter();

plainText = markdown.makeHtml("#Hi");

$(".hello").html(plainText);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top