Produced HTML should be semantic

Created on 1 July 2025, 6 days ago

Problem/Motivation

HTML is not semantic when added container and link:

<div class="field field--name-field-test-formatter-field field--type-string field--label-above">
    <div class="field__label">Test Formatter Field</div>
        <div class="field__item">
                <a href="/node/1" hreflang="en">
                        <div class="h3" data-source="abc">this is a fine field</div>
                </a>
        </div>
</div>

Steps to reproduce

- intall module
- setup a field as text field formatter
- add link and div to formatter
- output is not valid HTML

Proposed resolution

HTML should look like this:

<div class="field field--name-field-test-formatter-field field--type-string field--label-above">
    <div class="field__label">Test Formatter Field</div>
        <div class="field__item">
                <div class="h3" data-source="abc">
                        <a href="/node/1" hreflang="en">
this is a fine field</a>
                </div>
        </div>
</div>

Remaining tasks

Update code

User interface changes

none

API changes

none

Data model changes

none

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇦🇺Australia jannakha Brisbane!

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024