mirror of
https://github.com/andatoshiki/toshiki-notebook.git
synced 2026-06-06 00:46:29 +00:00
feat: add markdown utilities in theming for defining different regex for content and tags replacement
This commit is contained in:
parent
eef96d6775
commit
db49332444
@ -7,7 +7,7 @@ export function renderMarkdown(markdownText = '') {
|
||||
.replace(/^\> (.*$)/gim, '<blockquote>$1</blockquote>')
|
||||
.replace(/\*\*(.*)\*\*/gim, '<b>$1</b>')
|
||||
.replace(/\*(.*)\*/gim, '<i>$1</i>')
|
||||
.replace(/!\[(.*?)\]\((.*?)\)/gim, "<img alt='$1' src='$2' />")
|
||||
// .replace(/!\[(.*?)\]\((.*?)\)/gim, "<img alt='$1' src='$2' />")
|
||||
.replace(/\[(.*?)\]\((.*?)\)/gim, "<a href='$2'>$1</a>")
|
||||
.replace(/`(.*?)`/gim, '<code>$1</code>')
|
||||
.replace(/\n$/gim, '<br />')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user