Closed duncandewhurst closed 1 year ago
Would it be better to use make_id
from https://docutils.sourceforge.io/docutils/nodes.py directly, so that other cases besides -
are handled?
Good thinking :-) is doing that just a case of replacing ref.lower().replace('_', '-')
with make_id(ref)
?
Should be, yes.
@Bjwebb done!
LGTM, but the tests have broken on main since that was last updated. We need to fix that before this can be merged.
Rebased onto working main, so tests work now. I don't know if this PR needs some tests of it's own?
Sphinx replaces the
_
character in HTML anchors with-
, per https://docutils.sourceforge.io/docutils/nodes.py:This PR does the same in the links generated when
nocrossref
isn't specified.@Bjwebb I'm assuming that you're the right person to review this, but let me know if not!