File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -71,11 +71,12 @@ export function run() {
7171 computeType ( dfn , linkingText ) ;
7272 computeExport ( dfn ) ;
7373
74- // Only add `lt`s that are different from the text content
75- if ( titles . length === 1 && linkingText === norm ( dfn . textContent ) ) {
76- continue ;
74+ // Only add `lt`s that are different from the text content and local-lts
75+ const localLt = ( dfn . dataset . localLt || "" ) . split ( "|" ) . map ( norm ) ;
76+ const lt = titles . filter ( t => ! localLt . includes ( t ) ) ;
77+ if ( lt . length > 1 || linkingText !== norm ( dfn . textContent ) ) {
78+ dfn . dataset . lt = lt . join ( "|" ) ;
7779 }
78- dfn . dataset . lt = titles . join ( "|" ) ;
7980 }
8081}
8182
Original file line number Diff line number Diff line change @@ -221,6 +221,7 @@ describe("Core — Definitions", () => {
221221
222222 const dfnOnlyLocalLt = doc . querySelector ( "#only-local-lt dfn" ) ;
223223 expect ( dfnOnlyLocalLt . id ) . toBe ( "dfn-install" ) ;
224+ expect ( dfnOnlyLocalLt . dataset . lt ) . toBe ( undefined ) ;
224225 for ( const el of [ ...doc . querySelectorAll ( "#only-local-lt a" ) ] ) {
225226 expect ( el . hash ) . toBe ( "#dfn-install" ) ;
226227 }
You can’t perform that action at this time.
0 commit comments