commit a65ab2d084995ab66472b996c372c3e5d06e00ab
parent 13e2afd261496a3837856def4c29a1ad872fda59
Author: markseu <mark2011@mayberg.se>
Date: Mon, 25 Mar 2019 14:10:42 +0100
Updated Markdown extension
Diffstat:
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/system/extensions/markdown.php b/system/extensions/markdown.php
@@ -3756,7 +3756,7 @@ class YellowMarkdownExtraParser extends MarkdownExtraParser {
}
// Handle striketrough
- public function doStrikethrough($text) {
+ public function doStrikethrough($text) {
$parts = preg_split("/(?<![~])(~~)(?![~])/", $text, null, PREG_SPLIT_DELIM_CAPTURE);
if (count($parts)>3) {
$text = "";
@@ -3771,8 +3771,8 @@ class YellowMarkdownExtraParser extends MarkdownExtraParser {
}
if ($open) $text .= "</del>";
}
- return $text;
- }
+ return $text;
+ }
// Handle links
public function doAutoLinks($text) {
@@ -3875,27 +3875,27 @@ class YellowMarkdownExtraParser extends MarkdownExtraParser {
}
// Handle lists, task list
- public function _processListItems_callback($matches) {
+ public function _processListItems_callback($matches) {
$attr = "";
- $item = $matches[4];
- $leadingLine = $matches[1];
- $tailingLine = $matches[5];
- if ($leadingLine || $tailingLine || preg_match('/\n{2,}/', $item))
- {
- $item = $matches[2].str_repeat(' ', strlen($matches[3])).$item;
- $item = $this->runBlockGamut($this->outdent($item)."\n");
- } else {
- $item = $this->doLists($this->outdent($item));
- $item = $this->formParagraphs($item, false);
+ $item = $matches[4];
+ $leadingLine = $matches[1];
+ $tailingLine = $matches[5];
+ if ($leadingLine || $tailingLine || preg_match('/\n{2,}/', $item))
+ {
+ $item = $matches[2].str_repeat(' ', strlen($matches[3])).$item;
+ $item = $this->runBlockGamut($this->outdent($item)."\n");
+ } else {
+ $item = $this->doLists($this->outdent($item));
+ $item = $this->formParagraphs($item, false);
$token = substr($item, 0, 4);
if ($token=="[ ] " || $token=="[x] ") {
$attr = " class=\"task-list-item\"";
$item = ($token=='[ ] ' ? "<input type=\"checkbox\" disabled=\"disabled\" /> " :
"<input type=\"checkbox\" disabled=\"disabled\" checked=\"checked\" /> ").substr($item, 4);
}
- }
- return "<li$attr>".$item."</li>\n";
- }
+ }
+ return "<li$attr>".$item."</li>\n";
+ }
// Return unique id attribute
public function getIdAttribute($text) {