Browse Source

Bugfix for spaces in links

pull/1417/head
Michael Vogel 6 years ago
parent
commit
4a6a6ca937
2 changed files with 6 additions and 1 deletions
  1. +1
    -1
      include/bbcode.php
  2. +5
    -0
      library/markdown.php

+ 1
- 1
include/bbcode.php View File

@ -191,7 +191,7 @@ function bb_cleanup_share($shared, $plaintext, $nolink) {
if (isset($bookmark[1][0]))
$link = $bookmark[1][0];
if (($title != "") AND (strpos($title, $shared[1]) !== false))
if (($shared[1] != "") AND (strpos($title, $shared[1]) !== false))
$shared[1] = $title;
if (($title != "") AND ((strpos($shared[1],$title) !== false) OR


+ 5
- 0
library/markdown.php View File

@ -2,6 +2,11 @@
require_once("library/parsedown/Parsedown.php");
function Markdown($text) {
// Bugfix for the library:
// "[Title](http://domain.tld/ )" isn't handled correctly
$text = preg_replace("/\[(.*?)\]\s*?\(\s*?(\S*?)\s*?\)/ism", '[$1]($2)', $text);
$Parsedown = new Parsedown();
return($Parsedown->text($text));
}


Loading…
Cancel
Save