I dont know why but the blockquotes are not being rendered.
I type > text and while sending this message my PHP side converts it to > text. When fetched on the client side I get >text as the display while the HTML rendered is <p>> block</p>
I have the same issue. I even tried showdown.js and unfortunately it also doesn't render blockquote. I double checked I am using correct syntax for blockquote. Any fixes?
Probable fix is setting a proper css for the blockquote tag.
The problem is on my side and not in the library. I have some escaping/unescaping characters issue when using marked on dynamic text. Just tested 'document.getElementById('content').innerHTML = marked('> Test');` and it worked.
Adding how I fixed because it might help someone:
document.getElementById('content').innerHTML = marked(document.getElementById('content').innerText);
where div with id content had the raw markdown text. Had to use innerText() instead of innerHTML().
I have found the same question! By the suggest of upstairs, I fixed the problem by
// html
<div class="item-bd" id="content"></div>
<pre id="tmp" style="display: none">{{$article['content']}}</pre>
// js
var rawMd = document.getElementById('tmp').innerText;
document.getElementById('content').innerHTML = marked(rawMd);
Use <pre></pre>to save the raw markdown and then transform the content to html, it takes effect in my blog. Hope it can help others.
same issue
This issue should be closed. Since that's the issue is from the user not the lib itself. Remember to replace your string using .replace(/>+/g, '>') before put it into marked().
@joshbruce this is not related to marked
@Feder1co5oave: Thanks! I don't think I even saw this ticket before.