Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make EntityParser less greedy #193

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Util/RegexHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class RegexHelper
const LINK_TITLE = 26;

const REGEX_ESCAPABLE = '[!"#$%&\'()*+,.\/:;<=>?@[\\\\\]^_`{|}~-]';
const REGEX_ENTITY = '/&(?:#x[a-f0-9]{1,8}|#[0-9]{1,8}|[a-z][a-z0-9]{1,31});/i';
const REGEX_ENTITY = '/^&(?:#x[a-f0-9]{1,8}|#[0-9]{1,8}|[a-z][a-z0-9]{1,31});/i';
const REGEX_PUNCTUATION = '/^[\x{2000}-\x{206F}\x{2E00}-\x{2E7F}\\\\\'!"#\$%&\(\)\*\+,\-\.\\/:;<=>\?@\[\]\^_`\{\|\}~]/u';

protected $regex = [];
Expand Down
1 change: 1 addition & 0 deletions tests/functional/data/entities.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>&amp; before ©</p>
1 change: 1 addition & 0 deletions tests/functional/data/entities.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
& before &copy;