diff --git a/Parsedown.php b/Parsedown.php index c84ae75..e4c2ad3 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -766,6 +766,11 @@ class Parsedown # ~ + if (strpos($text, '~~') !== FALSE) + { + $text = preg_replace('/~~(?=\S)(.+?)(?<=\S)~~/s', '$1', $text); + } + if (strpos($text, '_') !== FALSE) { $text = preg_replace('/__(?=\S)(.+?)(?<=\S)__(?!_)/s', '$1', $text); diff --git a/tests/data/strikethrough.html b/tests/data/strikethrough.html new file mode 100644 index 0000000..bdcdc41 --- /dev/null +++ b/tests/data/strikethrough.html @@ -0,0 +1,3 @@ +

strikethrough

+

in the middle of a sentence

+

in the middle of a word

\ No newline at end of file diff --git a/tests/data/strikethrough.md b/tests/data/strikethrough.md new file mode 100644 index 0000000..6c7efaf --- /dev/null +++ b/tests/data/strikethrough.md @@ -0,0 +1,5 @@ +~~strikethrough~~ + +in the ~~middle~~ of a sentence + +in the middle of a w~~or~~d \ No newline at end of file