@@ -81,6 +81,7 @@ private function _parseStartTag($domString, $parent)
81
81
$ startTagMatch = [];
82
82
preg_match ($ this ->_startTagReg , $ domString , $ startTagMatch );
83
83
$ startTagName = $ startTagMatch [1 ] ?? '' ;
84
+
84
85
if (empty ($ startTagName ))
85
86
return [$ domString , null ];
86
87
@@ -131,13 +132,12 @@ private function _parseStartEndTag(& $domString, $node)
131
132
* @param $parent
132
133
* @return bool|string
133
134
*/
134
- private function _parseEndTag ($ domString , $ parent )
135
+ private function _parseEndTag ($ domString , $ node )
135
136
{
136
- if (empty ($ parent ->nodeName ))
137
+ if (empty ($ node ->nodeName ))
137
138
return $ domString ;
138
-
139
139
$ endTagMatch = [];
140
- if (preg_match ('/^\s*(<\/ ' . $ parent ->nodeName . '>)/is ' , $ domString , $ endTagMatch )) {
140
+ if (preg_match ('/^\s*(<\/ ' . $ node ->nodeName . '>)/is ' , $ domString , $ endTagMatch )) {
141
141
$ endTagPos = strpos ($ domString , $ endTagMatch [0 ]);
142
142
$ domString = substr ($ domString , $ endTagPos + strlen ($ endTagMatch [0 ]));
143
143
}
@@ -187,6 +187,7 @@ private function _parseAttrs($domString, $node)
187
187
*/
188
188
private function _parseContent ($ domString , $ parent )
189
189
{
190
+
190
191
# match content
191
192
$ contentMatch = [];
192
193
$ match = preg_match ($ this ->_contentReg , $ domString , $ contentMatch );
0 commit comments