【问题标题】:AEM anchor tag stripped out in locahostAEM 锚标记在 localhost 中被剥离
【发布时间】:2021-02-03 12:47:49
【问题描述】:

当我使用没有 href="" 的锚标记时,一切都很好并且按钮样式在那里,第二个 a 添加一个 href 它完全删除了锚标记,只留下父 div 中的文本

没有href:

<div class="container">
 <a class="button"> my button</a>
</div>

导致浏览器开发工具

<div class="container">
 <a class="button"> my button</a>
</div>

带href

<div class="container">
 <a  href="/content/mypage.html" class="button"> my button</a>
</div>

浏览器中的结果

<div class="container">
 my button
</div>

【问题讨论】:

    标签: aem


    【解决方案1】:

    看起来这可能是链接检查器的工作。尝试添加x-cq-linkchecker="skip"

    <div class="container">
     <a x-cq-linkchecker="skip" href="/content/mypage.html" class="button"> my button</a>
    </div>
    

    【讨论】:

    • 不,还是一样
    • 抱歉,打错了。谢谢@RaphaelSchweikert
    【解决方案2】:

    我猜可能也和xssconfig有关

    当您在示例中向 div 添加“href”属性时

    <div  href="/content/mypage.html" class="container">
     <a class="button"> my button</a>
    </div>
    

    一般情况下是不允许的,因此 AEM 可以将其删除 /libs/cq/xssprotection/config.xml

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-08
      • 2023-03-17
      • 2023-04-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多