Fix Parserus: Instead of an offset in the list of children, the index of the child was used
This commit is contained in:
parent
9cf8967bb8
commit
47f9353595
1 changed files with 3 additions and 1 deletions
4
vendor/miovisman/parserus/Parserus.php
vendored
4
vendor/miovisman/parserus/Parserus.php
vendored
|
@ -1268,7 +1268,8 @@ class Parserus
|
|||
return $this;
|
||||
}
|
||||
|
||||
$idx = array_search($id, $this->data[$pid]['children']);
|
||||
$key = array_search($id, $this->data[$pid]['children']);
|
||||
$idx = array_search($key, array_keys($this->data[$pid]['children']));
|
||||
$arrEnd = array_slice($this->data[$pid]['children'], $idx + 1);
|
||||
$this->data[$pid]['children'] = array_slice($this->data[$pid]['children'], 0, $idx);
|
||||
|
||||
|
@ -1284,6 +1285,7 @@ class Parserus
|
|||
}
|
||||
|
||||
$this->addTextNode((string) substr($this->data[$id]['text'], $pos), $pid);
|
||||
|
||||
unset($this->data[$id]);
|
||||
|
||||
$this->data[$pid]['children'] = array_merge($this->data[$pid]['children'], $arrEnd);
|
||||
|
|
Loading…
Reference in a new issue