diff --git a/admin/src/js/hyperdown.js b/admin/src/js/hyperdown.js index 5c43b910..bd267a0a 100644 --- a/admin/src/js/hyperdown.js +++ b/admin/src/js/hyperdown.js @@ -412,7 +412,7 @@ var link, matches, url; matches = 1 <= arguments.length ? slice.call(arguments, 0) : []; url = _this.cleanUrl(matches[2]); - link = _this.call('parseLink', url); + link = _this.call('parseLink', matches[2]); return matches[1] + "" + link + "" + matches[5]; }; })(this)); @@ -521,7 +521,6 @@ var matches, space, tab, type; if ((this.isBlock('list')) && !line.match(/^\s*\[((?:[^\]]|\\\]|\\\[)+?)\]:\s*(.+)$/)) { if (!!(line.match(/^(\s*)(~{3,}|`{3,})([^`~]*)$/i))) { - state.empty = 0; return true; } else if ((state.empty <= 1) && !!(matches = line.match(/^(\s*)\S+/)) && matches[1].length >= (block[3][0] + state.empty)) { state.empty = 0; @@ -562,6 +561,7 @@ } isAfterList = block[3][2]; if (isAfterList) { + state.empty = 0; this.combineBlock().setBlock(key); } else { (this.setBlock(key)).endBlock(); diff --git a/var/HyperDown.php b/var/HyperDown.php index 2f2e679d..2d70e526 100644 --- a/var/HyperDown.php +++ b/var/HyperDown.php @@ -544,7 +544,7 @@ class HyperDown "/(^|[^\"])(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)|(?:mailto:)?[_a-z0-9-\.\+]+@[_\w-]+\.[a-z]{2,})($|[^\"])/", function ($matches) use ($self) { $url = $self->cleanUrl($matches[2]); - $link = $self->call('parseLink', $url); + $link = $self->call('parseLink', $matches[2]); return "{$matches[1]}{$link}{$matches[5]}"; }, $text @@ -699,7 +699,6 @@ class HyperDown if ($this->isBlock('list') && !preg_match("/^\s*\[((?:[^\]]|\\]|\\[)+?)\]:\s*(.+)$/", $line)) { if (preg_match("/^(\s*)(~{3,}|`{3,})([^`~]*)$/i", $line)) { // ignore code - $state['empty'] = 0; return true; } elseif ($state['empty'] <= 1 && preg_match("/^(\s*)\S+/", $line, $matches) @@ -757,6 +756,7 @@ class HyperDown $isAfterList = $block[3][2]; if ($isAfterList) { + $state['empty'] = 0; $this->combineBlock() ->setBlock($key); } else {