Skip to content

Commit

Permalink
Special-case things like {{Promise}}<{{Foo}}> so they're not element …
Browse files Browse the repository at this point in the history
…autolinks.
  • Loading branch information
tabatkins committed Jan 9, 2025
1 parent 8e3b2f4 commit 29f0fa8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 4 additions & 0 deletions bikeshed/h/parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ def parseNode(
if first3 == "\\<{":
node = RawText.fromStream(s, start, start + 3, "<{")
return Result(node, start + 3)
if s.config.idl and first3 == "<{{":
# Catch things like `{{Promise}}<{{Foo}}>` from being parsed as element links
node = SafeText.fromStream(s, start, start + 1)
return Result(node, start + 1)
if first2 == "<{":
elementRes = parseAutolinkElement(s, start)
if elementRes.valid:
Expand Down
2 changes: 0 additions & 2 deletions tests/github/w3c/csswg-drafts/css-nav-1/Overview.console.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ LINE 1092: No 'dfn' refs found for 'nested browsing context'.
<a bs-line-number="1092" data-link-type="dfn" data-lt="nested browsing context">nested browsing context</a>
LINE 1093: No 'dfn' refs found for 'browsing context container' that are marked for export.
<a bs-line-number="1093" data-link-type="dfn" data-lt="browsing context container">browsing context container</a>
LINE 1507: No 'element-sub' refs found for 'focus()}'.
<{{HTMLOrSVGElement/focus()}}>
WARNING: Multiple elements have the same id '96797491':
<span> on line ~10, <span> on line ~10
Deduping, but this ID may not be stable across revisions.
Expand Down
4 changes: 2 additions & 2 deletions tests/github/w3c/csswg-drafts/css-nav-1/Overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -2378,7 +2378,7 @@ <h3 class="heading settled" data-level="9.2" id="css-property-spatialnavigationa
to move the focus to a <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container" id="ref-for-scroll-container①⑨">scroll container</a> and to scroll it,
but not to move the focus to its descendants.
However, if the focus is moved to a descendant by some other mean
(such as pressing the <span class="key">Tab</span> key or using the <code><a data-link-type="element-sub">focus()}</a></code> method)
(such as pressing the <span class="key">Tab</span> key or using the &lt;<code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/interaction.html#dom-focus" id="ref-for-dom-focus②">focus()</a></code>> method)
spatial navigation can be used to move the focus to other focusable descendants.</p>
<p class="note" role="note"><span class="marker">Note:</span> The <span class="css">scroll</span> value is <a data-link-type="dfn" href="#at-risk" id="ref-for-at-risk②">at-risk</a>.</p>
</dl>
Expand Down Expand Up @@ -3337,7 +3337,7 @@ <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content
"c3bd6e1d": {"dfnID":"c3bd6e1d","dfnText":"box fragment","external":true,"refSections":[{"refs":[{"id":"ref-for-box-fragment"},{"id":"ref-for-box-fragment\u2460"}],"title":"8.1. \nGlossary"},{"refs":[{"id":"ref-for-box-fragment\u2461"},{"id":"ref-for-box-fragment\u2462"}],"title":"8.4. \nFocus Navigation Heuristics"}],"url":"https://drafts.csswg.org/css-break-4/#box-fragment"},
"c51ad875": {"dfnID":"c51ad875","dfnText":"the body element","external":true,"refSections":[{"refs":[{"id":"ref-for-the-body-element-2"}],"title":"6.2.1. \nnavbeforefocus"},{"refs":[{"id":"ref-for-the-body-element-2\u2460"}],"title":"6.2.2. \nnavnotarget"},{"refs":[{"id":"ref-for-the-body-element-2\u2461"}],"title":"8.3. \nNavigation"}],"url":"https://html.spec.whatwg.org/multipage/dom.html#the-body-element-2"},
"can-be-manually-scrolled": {"dfnID":"can-be-manually-scrolled","dfnText":"can be manually scrolled","external":false,"refSections":[{"refs":[{"id":"ref-for-can-be-manually-scrolled"},{"id":"ref-for-can-be-manually-scrolled\u2460"},{"id":"ref-for-can-be-manually-scrolled\u2461"}],"title":"8.3. \nNavigation"}],"url":"#can-be-manually-scrolled"},
"d345f720": {"dfnID":"d345f720","dfnText":"focus(options)","external":true,"refSections":[{"refs":[{"id":"ref-for-dom-focus"}],"title":"3. \nOverview"},{"refs":[{"id":"ref-for-dom-focus\u2460"}],"title":"6.2.2. \nnavnotarget"}],"url":"https://html.spec.whatwg.org/multipage/interaction.html#dom-focus"},
"d345f720": {"dfnID":"d345f720","dfnText":"focus(options)","external":true,"refSections":[{"refs":[{"id":"ref-for-dom-focus"}],"title":"3. \nOverview"},{"refs":[{"id":"ref-for-dom-focus\u2460"}],"title":"6.2.2. \nnavnotarget"},{"refs":[{"id":"ref-for-dom-focus\u2461"}],"title":"9.2. \nControlling the interaction with scrolling: the spatial-navigation-action property"}],"url":"https://html.spec.whatwg.org/multipage/interaction.html#dom-focus"},
"d462b34f": {"dfnID":"d462b34f","dfnText":"node","external":true,"refSections":[{"refs":[{"id":"ref-for-boundary-point-node"},{"id":"ref-for-boundary-point-node\u2460"}],"title":"8.3. \nNavigation"}],"url":"https://dom.spec.whatwg.org/#boundary-point-node"},
"d95397a7": {"dfnID":"d95397a7","dfnText":"all","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-all"}],"title":"5.2. \nLow level APIs"}],"url":"https://drafts.csswg.org/css-cascade-5/#propdef-all"},
"dictdef-focusableareasoption": {"dfnID":"dictdef-focusableareasoption","dfnText":"FocusableAreasOption","external":false,"refSections":[{"refs":[{"id":"ref-for-dictdef-focusableareasoption"}],"title":"5.2. \nLow level APIs"}],"url":"#dictdef-focusableareasoption"},
Expand Down

0 comments on commit 29f0fa8

Please sign in to comment.