[
https://issues.apache.org/jira/browse/DOXIA-771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17910673#comment-17910673
]
Konrad Windszus commented on DOXIA-771:
---------------------------------------
For Maven Sites each heading automatically gets an anchor. There is no standard
way to create an anchor ID from an arbitrary heading text. The logic in
https://github.com/apache/maven-doxia/blob/a6158e2f29d8d2f12b606a5c18a147842f0ee78e/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java#L159
is applied, but this is an implementation detail, i.e. you should not
reference that manually (it is only supposed to be used with the TOC macro).
For the 2nd issue please provide a failing testcase in
https://github.com/apache/maven-doxia/blob/master/doxia-modules/doxia-module-markdown/src/test/java/org/apache/maven/doxia/module/markdown/MarkdownParserTest.java.
> Markdown: Generated anchors of headings are incompatible with "regular"
> inpage-links
> ------------------------------------------------------------------------------------
>
> Key: DOXIA-771
> URL: https://issues.apache.org/jira/browse/DOXIA-771
> Project: Maven Doxia
> Issue Type: Bug
> Affects Versions: 2.0.0-M12
> Reporter: Matthias Bünger
> Priority: Major
>
> (Disclaimer: I'm not sure if the issue is right here of must be placed in
> Doxiasitetools, please move it, if wrong).
> -----
> I updated a page of the Maven-Site (so I think affected version is latest
> 2.0.0-M12) and wanted to create links to section headings on the same page.
> The "regular" way according to Google is that anchors are generated with all
> lowercase, minus between words and removed special chars.
> So you can create a link like this
> {code}
> ### How do I skip unit tests when building a project?
> Create a [link to that](how-do-i-skip-unit-tests-when-building-a-project)
> {code}
> The IDE (IntelliJ) is happy with that (meaning shows no warning, that the
> anchor may not exist), but the link does not work, because DOXIA generates
> another anchor
> {code}
> <a id="How_do_I_skip_unit_tests_when_building_a_project.3F"></a>
> {code}
> Which results, that you (I did not find another way) you have to create the
> link using exactly this generated anchor
> {code}
> ### How do I skip unit tests when building a project?
> Create a [link to that](#How_do_I_skip_unit_tests_when_building_a_project.3F)
> {code}
> Which is not very intuitiv to write.
> Note:
> I also tried to manually create and use an anchor, e.g.
> {code}
> <a id="HowDoISkipUnitTests"></a>
> ### How do I skip unit tests when building a project?
> Create a [link to that](#HowDoISkipUnitTests)
> {code}
> But this manual defined anchor got totally ignored and not generated in the
> resulting HTML.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)