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

added "data-sort-value" to ignored HTML attributes #47

Merged
merged 1 commit into from
Mar 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion includes/Splitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private function buildSplitter() {
'<div.*?>|<\/div>|' . // attributes of div elements
'<span.*?>|<\/span>|' . // attributes of span elements
'<file>[^<]*<\/file>|' . // stuff inside file elements
'style=".+?"|class=".+?"|' . // styles and classes (e.g. of wikitables)
'style=".+?"|class=".+?"|data-sort-value=".+?"|' . // styles and classes (e.g. of wikitables)
Copy link
Owner

@bovender bovender Mar 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More generic variant could be:

Suggested change
'style=".+?"|class=".+?"|data-sort-value=".+?"|' . // styles and classes (e.g. of wikitables)
'style=".+?"|class=".+?"|data-[^=]+=".+?"|' . // styles and classes (e.g. of wikitables)

?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I don't have much time to test it, but what about something like this:
<[^>]*>
It would match all HTML Tags with or wihtout attributes.
Is there any case in which you have to replace anything inside a HTML tag?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

push

'<noautolinks>.*?<\/noautolinks>|' . // custom tag 'noautolinks'
'\[' . $urlPattern . '\s.+?\]|'. $urlPattern . '(?=\s|$)|' . // urls
'(?<=\b)\S+\@(?:\S+\.)+\S+(?=\b)' . // email addresses
Expand Down