Duplicate ID (due to <sup id=... pulled in .Summary

I just noticed, on my homepage, where I list articles with .Summary, and when the article (more than one) got a reference to <sup> via markdown [^1]: ..., then it will result Duplicated ID due to <sup id=fnref:1>. (Example)

When I don’t want to remove this reference from text, Ideally will be if that will not be passed to .Summary in the first place.

Not sure if that’s a but, but definitely causing validation issues.

This is a known issue (#7543), more accurately described in #8910.

I suspect you are manually splitting the summary with the <!--more--> comment. When you split the summary manually, HTML is not stripped.

Your options:

  1. Pass the summary through the plainify function to strip all HTML elements
  2. Pass the summary through the replaceRE function to strip sup elements
  3. Define the summary in front matter
  4. Rely on automatic summary splitting (remove the <!--more--> comment)

It gets tricky when you display links and images from one page in the context of another page. Link and image render hooks solve that problem for anchor and image elements, but we don’t have the same capability with footnotes or tables of contents.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.