I have a content file that is HTML (as opposed to markdown). I am using soft hyphens for some words that the CSS hyphenation misses.
I am also using the jekyll plugin jekyll-toc to automatically generate tables of contents.
Take the German word “EU-Datenschutzgrundverordnung”, for example. With appropriately placed soft hyphen entities, it looks like this: EU-Daten­schutz­grund­ver­ordnung
When I render the page without using jekyll-toc, it works fine.
Within the following, however
---
layout: default
robots: noindex
---
<div>
<div id="table-of-contents">
<a class="anchor" id="toc" aria-hidden="true"><span></span></a>
<h1>{{ page.title }}</h1>
{{ content | toc_only }}
</div>
<div id="markdown-content">
{{ content | inject_anchors }}
</div>
</div>
jekyll will render the HTML so that it appears verbatim.
The rendered output looks like this:
EU-Daten­schutz­grund­ver­ordnung
And the HTML looks like this:
EU-Daten&shyschutz&shygrund&shyver&shyordnung
Is there any way to prevent this?