Skip to content

Commit

Permalink
Merge pull request #492 from wouterj/speed-up-parser
Browse files Browse the repository at this point in the history
Fix performance of InlineLexer by delaying URI scheme checking
  • Loading branch information
linawolf authored Jul 14, 2023
2 parents dd1bad4 + e6feb23 commit 716c8aa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ protected function getCatchablePatterns(): array
return [
'\\\\``', // must be a separate case, as the next pattern would split in "\`" + "`", causing it to become a intepreted text
'\\\\[\s\S]', // Escaping hell... needs escaped slash in regex, but also in php.
ExternalReferenceResolver::SUPPORTED_SCHEMAS . ':[-a-zA-Z0-9()@:%_\\+.~#?&\\/=]*[-a-zA-Z0-9()@%_\\+~#&\\/=]', // standalone hyperlinks
'\\S+@\\S+\\.\\S+',
'[a-z0-9-]+_{2}', //Inline href.
'[a-z0-9-]+_{1}(?=[\s\.+]|$)', //Inline href.
Expand All @@ -76,6 +75,7 @@ protected function getCatchablePatterns(): array
'|',
'\\*\\*',
'\\*',
'\b(?<!:)[a-z0-9\\.\-+]{2,}:[-a-zA-Z0-9()@:%_\\+.~#?&\\/=]*[-a-zA-Z0-9()@%_\\+~#&\\/=]', // standalone hyperlinks
];
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/tests/guilabel/guilabel.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<p>Lorem ipsum dolor sit amet <span class="guilabel">Foo Bar</span>.</p>
<p>Lorem ipsum dolor sit amet<span class="guilabel">Foo Bar</span>.</p>
<p>Lorem ipsum dolor sit amet:guilabel:<code>Foo Bar</code>.</p>
<p>Lorem ipsum dolor sit amet <span class="guilabel">Foo-Bar</span>.</p>
2 changes: 1 addition & 1 deletion tests/Functional/tests/guilabel/guilabel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Lorem ipsum dolor sit amet :guilabel:`Foo Bar`.

Lorem ipsum dolor sit amet:guilabel:`Foo Bar`.

Lorem ipsum dolor sit amet :guilabel:`Foo-Bar`.
Lorem ipsum dolor sit amet :guilabel:`Foo-Bar`.

0 comments on commit 716c8aa

Please sign in to comment.