Inline Translation adds <span> within <head> #939
Labels
bug report
Issue: Ready for Work
Gate 4. Acknowledged. Issue is added to backlog and ready for development
This issue is exposed by the integration test
Magento\DesignEditor\Model\Translate\InlineTest::testProcessResponseBodyHtml
in the currentdevelop
branch.I don't know why it runs successfully in travis, but the failure seems correct to me, so that is the reason for this issue.
I'm unsure what the correct behavior should be, so I'll refrain from creating a PR with a fix. If you help me understand how the following issue should be handled, I might work on one in my quest get all integration tests passing locally.
The test uses the following fixture:
During the test, the title is transformed by the method
Magento\DesignEditor\Model\Translate\Inline\Parser::_specialTags()
fromto
The problem is that the
<head>
now contains a new<span>
node.This causes the following code in the test method to fail:
The exception message is
DOMDocument::loadHTML(): Unexpected end tag : head in Entity, line: 11
The reason why I think this happens is because according to http://www.w3.org/TR/html401/struct/global.html#h-7.4.1 the closing
</head>
tag is optional.Because of this, it seems that as soon as the parser encounters the
<span>
element after<title>
, it markes the<head>
as implicitly closed, and the<body>
as the current context, and thus chokes on the following closing</head>
.So at least for that doctype there must be no
<span>
within<head>
.No idea how inline translation of the page title should be handled instead.
The text was updated successfully, but these errors were encountered: