You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is exposed by the integration test Magento\DesignEditor\Model\Translate\InlineTest::testProcessResponseBodyHtml in the current develop 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:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>{{{shown_0}}{{translated_0}}{{original_0}}{{scope_0}}}</title>
</head>
<body>
<divtitle="some_title_{{{shown_1}}{{translated_1}}{{original_1}}{{scope_1}}}_in_div">
some_text_{{{shown_2}}{{translated_2}}{{original_2}}{{scope_2}}}_in_div
</div>
</body>
</html>
During the test, the title is transformed by the method Magento\DesignEditor\Model\Translate\Inline\Parser::_specialTags() from
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:
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: