bowman2001 / perplex

A Hugo theme to publish technical content (docs, news, blog, articles)
https://perplex.desider.at
Apache License 2.0
27 stars 11 forks source link

A link in the paragraph before <!--more--> breaks list pages (e.g. blog card page) #137

Closed danielfdickinson closed 8 months ago

danielfdickinson commented 8 months ago

There was a warning in the notes that links don't work in summaries, but it is easy, especially when bringing in old content, to have a first paragraph that has a link. And, in any event, this should be protected from by the template rather than a potential source of user error that breaks the theme.

The solution is to use | htmlUnescape | plainfy on any summary or description which is wrapped in link (it is the link in a link that causes breakage).

E.g. .Summary | htmlUnescape | plainify and .Description | htmlUnescape | plainify.

I'll submit a proposed pull request shortly.

The htmlUnescape is so that typographic characters which have been converted to html entities are correctly rendered (converted to Unicode / UTF-8 rather than being output as e.g. &rsquo for ).