Skip to content

Commit 9314045

Browse files
committed
[BUGFIX] Draw the unresolved-reference marker, and say it plainly
Amends the previous commit after review. The screen-reader-only sentence is withdrawn. It was a real text node, and confval-menu renders its field content and then runs striptags over the result, so with "max=" set the sentence became visible table text, became the cell's tooltip, and added 38 characters to the length that decides whether the value is truncated at all. Keeping it would mean coupling two templates through a literal string or teaching an unrelated feature a regex filter; neither belongs in this change. The measured benefit was also smaller than claimed: Chrome already exposes the title attribute as the marker's accessible description. What stays is what was measured. Before, computed textDecorationLine on span.invalid-link was "none": "dotted" sets only the style, and the shorthand resolves the omitted line to its initial value. The marker was distinguished from surrounding text by a #f2f2f2 background and nothing else, which is WCAG 1.4.1 Use of Color. With a line value the dotted underline is drawn, in the text colour, so the cue is achromatic. The wording loses "anymore". It asserts that the reference once worked; the fixture's two references never resolved, and the build logs "Inventory link not found" for both. Same element, same change, one word. Also drops a dead branch: the span sits in the else of "if node.url" and opened with "if node.url" again, so its first arm could never be taken. Assisted-by: claude-code:claude-opus-5 Agent-Session: https://claude.ai/code/session_012Zm6UrYoeXRnucAdTdLRuN Agent-Host: 0493f0 Signed-off-by: Sebastian Mendel <github@sebastianmendel.de>
1 parent 63caebb commit 9314045

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

  • packages/typo3-docs-theme/resources/template/inline

packages/typo3-docs-theme/resources/template/inline/link.html.twig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
{{- node.value -}}
77
</a>
88
{%- else -%}
9-
<span class="invalid-link" title="This link cannot be resolved anymore">
9+
<span class="invalid-link" title="This link cannot be resolved">
1010
{%- if node.interlinkDomain -%}{{ node.interlinkDomain }}:{%- endif -%}{{- node.targetReference -}}
11-
<span class="visually-hidden"> (this link cannot be resolved anymore)</span>{#- -#}
1211
</span>
1312
{%- endif -%}

tests/Integration/tests/interlink/interlink-warn/expected/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<section class="section" id="document-title">
33
<h1>Document Title<a class="headerlink" href="#document-title" data-bs-toggle="modal" data-bs-target="#linkReferenceModal" title="Reference this headline">&nbsp;<i class="fa-solid fa-link"></i></a></h1>
44

5-
<p>See <span class="invalid-link" title="This link cannot be resolved anymore">t3tsref:data-type-list<span class="visually-hidden"> (this link cannot be resolved anymore)</span></span>.</p>
5+
<p>See <span class="invalid-link" title="This link cannot be resolved">t3tsref:data-type-list</span>.</p>
66

77

8-
<p>See also <span class="invalid-link" title="This link cannot be resolved anymore">t3tsref:data-type-page-id<span class="visually-hidden"> (this link cannot be resolved anymore)</span></span>.</p>
8+
<p>See also <span class="invalid-link" title="This link cannot be resolved">t3tsref:data-type-page-id</span>.</p>
99

1010
</section>
1111
<!-- content end -->

0 commit comments

Comments
 (0)