md2html: Support hrefs
This commit is contained in:
parent
40fd096894
commit
0d4b08206d
1
md2html
1
md2html
@ -59,6 +59,7 @@ function inline(text) {
|
|||||||
text = gensub(/\*\*([^\*]*)\*\*/, "<strong>\\1</strong>", "g", text)
|
text = gensub(/\*\*([^\*]*)\*\*/, "<strong>\\1</strong>", "g", text)
|
||||||
text = gensub(/\*([^\*]*)\*/, "<em>\\1</em>", "g", text)
|
text = gensub(/\*([^\*]*)\*/, "<em>\\1</em>", "g", text)
|
||||||
text = gensub(/`([^`]*)`/, "<code>\\1</code>", "g", text)
|
text = gensub(/`([^`]*)`/, "<code>\\1</code>", "g", text)
|
||||||
|
text = gensub(/\[(.*)\]\((.*)\)/, "<a href=\"\\2\">\\1</a>", "g", text)
|
||||||
return text
|
return text
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user