Use hpath:find header link logic for HyWiki links#865
Merged
Conversation
* hywiki.el (hywiki--org-link-html-format): Use
`hpath:dashes-to-spaces-markup-anchor' to make header match target.
* test/hywiki-tests.el (hywiki-tests--action-key-moves-to-word-and-section-using-dash-to-space-conversion):
Add test for headers with dashes.
(hywiki-tests--published-html-links-to-word-and-section): Update test to
the dash to space conversion in headers.
29c6a84 to
d25087f
Compare
rswgnu
approved these changes
Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Use hpath:find header link logic for HyWiki links.
`hpath:dashes-to-spaces-markup-anchor' to make header match target.
Add test for headers with dashes.
(hywiki-tests--published-html-links-to-word-and-section): Update test to
the dash to space conversion in headers.
Why
hpath:find is a central part of both pathname headers (links) and
hywiki headers. Using a common scheme for both makes both usage and
implementation simpler.
In the published html links should go to the same header as within
HyWiki-mode.
Note
The dash to space conversion scheme means this types of links.
Space conversion scheme
"File#word-word-word" -> # word word word
"File#word word word" -> # word word word
"File#word word-word" -> # word word-word (Verbatim if both space and dash)
If File's mode is derived from prog-mode the header will be used
verbatim.
Headers that contains no space but a dash will not be possible to link
to.
HyWiki
For HyWiki this means, and copied from the new test:
Publishing
The generated pages will keep how they look, no dash substitution, but
the link will link to the header (target) as within hywiki-mode.