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

Little bugfix read_tags and parse_selector regex function #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Little bugfix read_tags and parse_selector regex function #82

wants to merge 1 commit into from

Conversation

adriannh48
Copy link

I was having trouble loading the string with the HTML code by the function:
HtmlDomParser::str_get_html($file_name);

if (!preg_match("/^[\w-:]+$/", $tag)) {
if (!preg_match("/^[\w:]+$/", $tag)) {

Choose a reason for hiding this comment

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

I think it's not supposed to be removed but escaped by slash (-)

@@ -693,7 +693,7 @@ protected function parse_selector($selector_string) {
// This implies that an html attribute specifier may start with an @ sign that is NOT captured by the expression.
// farther study is required to determine of this should be documented or removed.
// $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
$pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
$pattern = "/([\w:\*]*)(?:\#([\w]+)|\.([\w]+))?(?:\[@?(!?[\w:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";

Choose a reason for hiding this comment

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

I think it's not supposed to be removed but escaped by slash (-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants