Skip to content

Edit in place feature is broken if translations has tag attributes #293

Open
@bocharsky-bw

Description

@bocharsky-bw

Looks like double quotes are not escaped that leads to broken HTML layout:
Screen Shot 2019-03-13 at 16 03 04

Source code:

<h1 class="text-center"><x-trans data-key="messages|test.html" data-value="Text <b class="test">Bold</b>." data-plain="Text <b class="test">Bold</b>." data-domain="messages" data-locale="en">Text <b class="test">Bold</b>.</x-trans></h1>

Code in Twig template:

<h1 class="text-center">{{ 'test.html'|trans|raw }}</h1>

Translation:

    <unit id="yOjYJE6" name="test.html">
      <notes>
        <note category="file-source" priority="1">templates/index.html.twig:8</note>
      </notes>
      <segment>
        <source>test.html</source>
        <target><![CDATA[Text <b class="test">Bold</b>.]]></target>
      </segment>
    </unit>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions