anchor is renamed to span without removing attribute target
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- html, javascript
Research direction
Start in src/core/figures.js at the linked lines 115–118 and read how anchor elements in figure captions are transformed for the list of figures. Check which non-global attributes remain after the transformation, including target. Update the removal behavior and run the relevant figure tests; done means the transformed caption link no longer retains attributes that do not apply to the resulting span.
Written by the indexing model from the issue text.
Description
Description of problem
When a figcaption holds an anchor element (using respec html syntax), this element is renamed to a span for the list of figures. Only the href attribute is removed. The removal of attributes should happen for all non global attributes, like target as the user could have used that in his/her document.
<figure id="fig-image">
<img src="image.png" alt="image alt text" />
<figcaption>Image with anchor <a href="https://an.url.org/" target="_blank">link</a>.</figcaption>
</figure>
See https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element for possible attributes.
What happened (e.g., it crashed)?:
Not able to create correct respec output when using a hyperlink in a figcaption. The publication process blocks on this issue.
Expected behavior (e.g., it shouldn't crash):
We expect with renaming of elements that all optional attributes are considered.
- Dominant language
- JavaScript
- Stars
- 807
- Forks
- 440
- Avg merge
- 1h 2m
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from speced/respec
-
Difficulty 1/5 Under an hour Newbie friendliness 95/100
Maintainers usually reply within 1 day
-
core/caniuse silently drops the browser-support table when .head dl is missingMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug: closest('[data-link-for]') in scoping hint can match the anchor itselfPossibly taken @marcoscaceres claimed this 69 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
W3C specStatus should raise an error when not on w3.org/TR/Possibly taken @pchampin claimed this 35 days ago. OpenFeature request
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Feature request
Difficulty 4/5 3-5 days Newbie friendliness 47/100
speced/respec#5435 · 1 reaction ·
Maintainers usually reply within 1 day
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ericcornelissen/depreman#591 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
NanmiCoder/dsh-agent-teams#269 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
docs
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
idean3885/claude-ops-agent#765 ·
Maintainers usually reply within 1 day
-
docs html v6
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day