issue: keep image formatting after edit
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 25 Nov 2021 23:51:53 +0000 (00:51 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 26 Nov 2021 00:22:05 +0000 (01:22 +0100)
upload.inc.php

index f2e101a3a9faa4d412eb28c0e42d3778a30ea076..962bedcbebc2fb73ae64643398cf3075d31408d7 100644 (file)
@@ -63,6 +63,7 @@ function messagehtml($input)
                '{<([^>\s|]+)[\s|]([^>]+)>}'   => '<a href="$1">$2</a>', # hyperlink
                "/\r\n?/" => "\n",        # unix newlines
                "/  +\n/" => "<br />",    # trailing spaces for hard line break
+               '{^(/data/.*\.jpe?g)\z}m'      => '<img src="/thumb/640x/\1" />', # image reference
                "/^[-*] (.*)$\n?/m"            => '<li>$1</li>',         # list item
                "/^(.+)$\n?/m"                 => "<p>$1</p>\n",         # paragraph
                "{^<p>(<li>.*</li>)(?:</p>\n)?}m" => "<ul>$1</ul>\n",    # list container