Warning: DOMDocumentFragment::appendXML(): Entity: line 18: parser error : Attribute lang redefined in Drupal\toc_api\TocBuilder->renderContent() (line 77 of modules/contrib/toc_api/src/TocBuilder.php).
Warning: DOMDocumentFragment::appendXML():
1) 1、renderContent() (line 77 of modules/contrib/toc_api/src/TocBuilder.php).
Issue fork toc_api-2841748
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
anxinax commentedComment #3
anxinax commentedWarning: DOMDocumentFragment::appendXML():
1) 1、
renderContent() (line 77 of modules/contrib/toc_api/src/TocBuilder.php).Comment #4
vladimirausThanks for reporting.
Can we get starps on how to reproduce it and full error stack?
Comment #5
joelpittetI'm seeing this as well, the step was a rouge HTML from Word pasting. Here's the error
It's failing on the multiple
langattributesComment #7
joelpittetOk the MR above fixes the problem, it uses the same function used by the filter for text formats "Correct faulty and chopped off HTML" aka
filter_htmlcorrectorComment #8
smulvih2I was getting this error when exporting content using the drupal/default_content_deploy module. It appears some of my migrated content also has duplicate lang attributes on an element. Applying patch from MR#6 resolved the issue for me. Also confirmed that the TOC token being used on these pages works correctly.
Comment #10
vladimirausThank you! Committed and released! 🍻