diff --git a/strictdoc/backend/sdoc/models/anchor.py b/strictdoc/backend/sdoc/models/anchor.py index 622611e3f..2c1dd9f86 100644 --- a/strictdoc/backend/sdoc/models/anchor.py +++ b/strictdoc/backend/sdoc/models/anchor.py @@ -30,11 +30,11 @@ def get_display_title(self) -> str: def document(self): if self.parent.parent.__class__.__name__ == "SDocDocument": return self.parent.parent - return self.parent.parent.document + return self.parent_node().document @property def parent_or_including_document(self): - return self.parent.parent_or_including_document + return self.parent_node().parent_or_including_document def parent_node(self) -> Any: # Anchor -> FreeText -> Section|Document diff --git a/tests/integration/commands/export/html/markup/03_referencing_anchor_with_LINK_external/input.sdoc b/tests/integration/commands/export/html/markup/03_referencing_anchor_with_LINK_external/input.sdoc index c226da534..7f416748c 100644 --- a/tests/integration/commands/export/html/markup/03_referencing_anchor_with_LINK_external/input.sdoc +++ b/tests/integration/commands/export/html/markup/03_referencing_anchor_with_LINK_external/input.sdoc @@ -12,4 +12,13 @@ See the [LINK: AD2] for more details. See the [LINK: Interface_Control_Document] for more details. [/FREETEXT] +[TEXT] +STATEMENT: >>> +See the [LINK: AD4] for more details. + +See the [LINK: AD5] for more details. + +See the [LINK: Supplemental Guide] for more details. +<<< + [/SECTION] diff --git a/tests/integration/commands/export/html/markup/03_referencing_anchor_with_LINK_external/input2.sdoc b/tests/integration/commands/export/html/markup/03_referencing_anchor_with_LINK_external/input2.sdoc index a8fcd3b17..d04064127 100644 --- a/tests/integration/commands/export/html/markup/03_referencing_anchor_with_LINK_external/input2.sdoc +++ b/tests/integration/commands/export/html/markup/03_referencing_anchor_with_LINK_external/input2.sdoc @@ -23,4 +23,21 @@ Anchors end. [/FREETEXT] +[TEXT] +STATEMENT: >>> +[ANCHOR: AD4] + +1) AD4. Threat Model. + +[ANCHOR: AD5, Software Tests] + +2) AD5. Software Tests. + +[ANCHOR: Supplemental Guide] + +3) AD6. Supplemental Guide. + +Anchors end. +<<< + [/SECTION] diff --git a/tests/integration/commands/export/html/markup/03_referencing_anchor_with_LINK_external/test.itest b/tests/integration/commands/export/html/markup/03_referencing_anchor_with_LINK_external/test.itest index 6546a7925..e8438d959 100644 --- a/tests/integration/commands/export/html/markup/03_referencing_anchor_with_LINK_external/test.itest +++ b/tests/integration/commands/export/html/markup/03_referencing_anchor_with_LINK_external/test.itest @@ -5,6 +5,9 @@ RUN: %cat %S/Output/html/03_referencing_anchor_with_LINK_external/input.html | f CHECK-HTML-DOC:
See the {{.*}}AD1 for more details.
CHECK-HTML-DOC:See the {{.*}}Software requirements specification for more details.
CHECK-HTML-DOC:See the {{.*}}Interface_Control_Document for more details.
+CHECK-HTML-DOC:See the {{.*}}AD4 for more details.
+CHECK-HTML-DOC:See the {{.*}}Software Tests for more details.
+CHECK-HTML-DOC:See the {{.*}}Supplemental Guide for more details.
RUN: %cat %S/Output/html/03_referencing_anchor_with_LINK_external/input2.html | filecheck %s --dump-input=fail --check-prefix CHECK-HTML-DOC2 CHECK-HTML-DOC2: