내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Anchor tag ada issue - Richtext component

Avatar

Level 2

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.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Community Advisor and Adobe Champion

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'} 

원본 게시물의 솔루션 보기

1 답변 개

Avatar

정확한 답변 작성자:
Community Advisor and Adobe Champion

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'}