Anchor tag ada issue - Richtext component | Community
Skip to main content
Level 2
Nov 17, 2021 12:58 PM UTC
Solved

Anchor tag ada issue - Richtext component

Hi Team,

 

This anchor field is generating the markup in the form:  <a  id = "name provided through authoring field"></a> - out of box behaviour of aem rich text component

Its throwing some ada compliance issue.

is there way to change a tag to span tag.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
BrianKasingli
BrianKasingliAccepted solution
New Participant
Jul 12, 2023 10:11 PM UTC

Yes, in Sling Model, you can do something like this:

@Model(adaptables=Resource.class) public class MyTextComponent { @Optional @ValueMapValue @1497330(values = "") private String text; private String richText; @PostConstruct protected void init() { if (!text.isEmpty()) { richText = text.replaceAll("</?span>", ""); } } public String getRichText() { return richText; } }

in Sightly you can just call ${model.richText @ context='html'} 

1 reply

BrianKasingli
BrianKasingliAccepted solution
New Participant
Jul 12, 2023 10:11 PM UTC

Yes, in Sling Model, you can do something like this:

@Model(adaptables=Resource.class) public class MyTextComponent { @Optional @ValueMapValue @1497330(values = "") private String text; private String richText; @PostConstruct protected void init() { if (!text.isEmpty()) { richText = text.replaceAll("</?span>", ""); } } public String getRichText() { return richText; } }

in Sightly you can just call ${model.richText @ context='html'} 

Translate