Closed prasannaupadhya closed 2 years ago
There is no provision in the CommonMark spec or GitHub Markdown spec for handing classes in mark down. Said a different way, there is not a defined way to add class metdata to markdown. Unfortunately that means this is not something we can add to showdown. You may consider creating an extension to read a custom class syntax.
See the extension documentation here. Note that this will change in 3.0.0 and likely become easier.
Hi,
Thanks for this library,
I am trying to convert
HTML
text toMARKDOWN
and save the content. If I want to edit text, then I want to convertMARKDOWN
text toHTML
format again.I can do both by using
makeHtml
andmakeMarkdown
. But the problem iscustom tags
.Ex: I have HTML text like:
<!DOCTYPE HTML><html><body><h1 class="the-cls-name">Test One<h1><br></body></html>
When it is converted to markdown format(using
makeMarkdown
), the output will be:# Test One
.When I want to edit this text, then again it will convert to HTML text from
MARKDOWN
(usingmakeHtml
),But in case, I should have the same class name like
class="the-cls-name"
in HTML.But what I am getting is:
<h1 id="testone">Test One</h1><h1 id="nbsp"> </h1>
.I want result like:
<h1 class="the-cls-name">Test One<h1>
.Is that possible?
I am doing something like this (pseudo-code):