Add strikethrough support to markdown parser (~~text~~)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -41,6 +41,9 @@ function parseMarkdown(markdown) {
|
|||||||
html = html.replace(/\*(.+?)\*/g, '<em>$1</em>');
|
html = html.replace(/\*(.+?)\*/g, '<em>$1</em>');
|
||||||
html = html.replace(/_(.+?)_/g, '<em>$1</em>');
|
html = html.replace(/_(.+?)_/g, '<em>$1</em>');
|
||||||
|
|
||||||
|
// Strikethrough (~~text~~)
|
||||||
|
html = html.replace(/~~(.+?)~~/g, '<del>$1</del>');
|
||||||
|
|
||||||
// Images  - must come before link handler
|
// Images  - must come before link handler
|
||||||
html = html.replace(/!\[([^\]]*)\]\(([^)]+)\)/g, function(match, alt, url) {
|
html = html.replace(/!\[([^\]]*)\]\(([^)]+)\)/g, function(match, alt, url) {
|
||||||
if (/^https?:/i.test(url)) {
|
if (/^https?:/i.test(url)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user