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.
Solved! Go to Solution.
Yes, in Sling Model, you can do something like this:
@Model(adaptables=Resource.class)
public class MyTextComponent {
@Optional
@ValueMapValue
@default(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'}
Yes, in Sling Model, you can do something like this:
@Model(adaptables=Resource.class)
public class MyTextComponent {
@Optional
@ValueMapValue
@default(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'}