1
votes

I have allowedcontent=true which is working and allowing me to have attributes in my opening tags; however, CKEdtior is still removing the closing tag attributes. I am using the editor to allow modification of simple Handlebars templates that use {{each}} and {{/each}}. The issue comes when using this with a table and wanting to repeat my rows.

For example, I have the following HTML entered into source:

<table>
        <tr data-each={{each Person}}">
            <td class="col-student-id">{{Identifier}}</td>
            <td class="col-name">{{Name}}</td>
        </tr data-each="{{/each}}">
</table>

When I click out of source, it removes the attribute on my closing tr tag.

Is there anyway to force CKEditor to not remove this attribute? If not, does anyone know of a way to allows me to use something like this:

<table>
{{each Person}}
        <tr>
            <td class="col-student-id">{{Identifier}}</td>
            <td class="col-name">{{Name}}</td>
        </tr>
{{/each}}
</table>

When I try the above example, it is reformatted to be:

<section>{{each Person}} {{/each}}
<table>
        <tr>
            <td class="col-student-id">{{Identifier}}</td>
            <td class="col-name">{{Name}}</td>
        </tr>
</table>
1

1 Answers

0
votes

Your input source code is invalid - closing tags cannot have attributes in HTML, so CKEditor ignores them. Read more in CKEditor HTML Autocorrection Issue.