markdownToHTML: Difference between revisions
No edit summary |
No edit summary |
(No difference)
|
Latest revision as of 23:59, 15 March 2023
markdownToHTML() Function
Usage
markdownToHTML(string)
markdownToHTML(string, type)
Parameters
string
- The markdown text to be converted.type
- The format of the markdown used as input.
The following types of Markdown are supported. Any of these profile names can be passed as strings for the type
parameter.
COMMONMARK
COMMONMARK_0_26
COMMONMARK_0_27
COMMONMARK_0_28
COMMONMARK_0_29
FIXED_INDENT
GITHUB
GITHUB_DOC
KRAMDOWN
MARKDOWN
MULTI_MARKDOWN
PEGDOWN
PEGDOWN_STRICT
The details of which features are included in which profile seem to be difficult to find. However, the CommonMark standard that attempts to define what all Markdown profiles should include is available here. And a web search for the above keywords should produce links that provide a summary of the feature set for each profile.
The details of which features are actually supported are available on the software's Wiki page. But without a list identifying which extensions are part of which profile, it's not clear how a user should select a particular one.
Examples
[frame5("Notes", "title=" + token.name): {<br>
[r: markdownToHTML(getNotes())]
}]
Same as the previous example, but check first to see if the Notes field already contains HTML.
[h: html = startsWith(getNotes(), "<")]
[h, if(html==1):
content = getNotes();
content = markdownToHTML(getNotes(), "GITHUB_DOC")]
[frame5("Notes", "title=" + token.name): {
[r: content]
}]