给MovableType的Markdown加上删除线支持

MovableType的MarkDown格式不支持删除线。下面是别人写的patch.

--- mt.bk/plugins/Markdown/Markdown.pl  2012-05-10 05:03:28.000000000 -0400
+++ mt/plugins/Markdown/Markdown.pl 2012-08-21 04:29:37.000000000 -0400
@@ -971,6 +971,10 @@
$text =~ s{ (\*|_) (?=\S) (.+?) (?<=\S) \1 }
{<em>$2</em>}gsx;
+    # These lines added by Bill Eccles, 2008-07-04
+    $text =~ s{ (\s) (~~) (?=\S) (.+?) (?<=\S) (~~) }
+    {$1<strike>$3</strike>}gsx;
+
return $text;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.