hlxsites / prisma-cloud-docs-website

blocks and gdoc authored content for https://docs.prismacloud.io
Apache License 2.0
3 stars 2 forks source link

[AsciiDoc conversion] Underscores stripped from anchors #167

Closed iansk closed 11 months ago

iansk commented 11 months ago

In AsciiDoc, all sections, by default, have an anchor or ID. You can manually override the like this:

[#some-crazy-anchor]
== My Heading

Some para text.

The Franklin adoc-to-HTML converter strips out underscores for anchors that start with an underscore (e.g. #_hello is transformed to #hello).

However, if there's an underscore in the middle of the string, the converters leaves it alone. (e.g. #good_bye is left as #good_bye.

We've got a lot of pre-existing content where anchors start with an underscore, so if Franklin does support the syntax, we'd like to fix this.

Tests:

  1. Adoc source to test anchors and internal cross reference links to those anchors: https://github.com/hlxsites/prisma-cloud-docs/blob/edda943b9f1bd214b597c3546900c146db6ad4a0/docs/en/enterprise-edition/content-collections/governance/custom-build-policies/custom-build-policy-examples.adoc?plain=1#L8-L35

  2. Site preview of this page in action: https://main--prisma-cloud-docs-website--hlxsites.hlx.page/prisma/prisma-cloud/en/enterprise-edition/content-collections/governance/custom-build-policies/custom-build-policy-examples?branch=ian-test-anchors#good_bye

iansk commented 11 months ago

We'll live with it.

iansk commented 11 months ago

Closing