Merge pull request #6590 from MrPetovan/bug/6585-diaspora-ignore-escaped-asterisks
authorTobias Diekershoff <tobias.diekershoff@gmx.net>
Tue, 5 Feb 2019 06:49:54 +0000 (07:49 +0100)
committerGitHub <noreply@github.com>
Tue, 5 Feb 2019 06:49:54 +0000 (07:49 +0100)
Diaspora: Remove asterisk-meddling regular expression

mod/babel.php
src/Content/Text/Markdown.php

index 6e47b81..51bbf7c 100644 (file)
@@ -98,7 +98,7 @@ function babel_content()
                                $html = Text\Markdown::convert($markdown);
                                $results[] = [
                                        'title' => L10n::t('Markdown::convert (raw HTML)'),
-                                       'content' => htmlspecialchars($html)
+                                       'content' => visible_whitespace(htmlspecialchars($html))
                                ];
 
                                $results[] = [
index 977ecd3..ceb5b04 100644 (file)
@@ -83,9 +83,6 @@ class Markdown extends BaseObject
        {
                $s = html_entity_decode($s, ENT_COMPAT, 'UTF-8');
 
-               // Replace lonely stars in lines not starting with it with literal stars
-               $s = preg_replace('/^([^\*]+)\*([^\*]*)$/im', '$1\*$2', $s);
-
                // The parser cannot handle paragraphs correctly
                $s = str_replace(['</p>', '<p>', '<p dir="ltr">'], ['<br>', '<br>', '<br>'], $s);