Skip to content

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