strictdoc-project / strictdoc

Software for technical documentation and requirements management.
https://strictdoc.readthedocs.io/en/stable/
Other
151 stars 24 forks source link

LINKs: Anchors with IDs containing whitespace are not referrable in exported HTML #1916

Closed haxtibal closed 2 months ago

haxtibal commented 2 months ago

This sdoc

[DOCUMENT]
TITLE: Link Test

[TEXT]
STATEMENT: >>>
[ANCHOR: ID 1]
<<<

[REQUIREMENT]
UID: REQ-1
STATEMENT: >>>
[LINK: ID 1]
<<<

generates an anchor like <sdoc-anchor id="ID 1" node-role="section" data-uid="ID 1" data-anchor="ID 1" style="top:unset">...</sdoc-anchor> and refers to it with <a href="#ID-1">🔗&nbsp;ID 1</a>.

Note how id contains a whitespace, but href has the whitespace replaced with dash. Replacing with dash makes sense because UID may contain whitespace in sdoc but id must not contain whitespaces in HTML. We just have to do the replacement on both ends.

Will try to fix that.