🐛 Keep target anchors rendered in tab-set and tab-set-code#275
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #275 +/- ##
==========================================
+ Coverage 89.95% 90.08% +0.12%
==========================================
Files 12 12
Lines 1115 1119 +4
==========================================
+ Hits 1003 1008 +5
+ Misses 112 111 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Follow-up to #271, which preserved target nodes but not their anchors: - docutils PropagateTargets moves a preceding target's ids onto the tab-item container, which TabSetHtmlTransform destroys — copy the container's ids onto the rendered label so href targets exist - tab-set-code dropped targets entirely (asymmetric with tab-set) — preserve them the same way - strengthen the target test to assert a rendered node carries the id and that it appears in the built HTML (the previous assertions passed against the broken output); add a tab-set-code variant - get_started: clarify that examples may need extending myst_enable_extensions beyond the snippet shown
8a4720d to
dd64f37
Compare
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up fixing two bugs found in a retrospective review of #271 (which preserved target nodes but not their anchors):
PropagateTargetsmoves a preceding target's ids onto the tab-item container, whichTabSetHtmlTransformdestroys (it only copied the rubric's ids) — sohref="#my-target"pointed at nothing in HTML. The container's ids are now carried onto the rendered label.The #271 test passed against the broken output because it asserted target-node survival and
refidresolution, but never that any rendered node still carries the id — it now asserts both that and the literalid="…"in the built HTML (verified to fail against unfixed code), plus a new tab-set-code variant.Also includes the review's docs nit:
get_started.mdnow says the extra MyST extensions need to be added to themyst_enable_extensionssnippet shown, rather than implying the snippet already enables them.Note: the
py311-no-mystenv fails on this branch's base due to #271's unguarded myst-parametrized tests — that fix is in #274; after it merges this branch rebases cleanly (mid-file edits only).Validation:
tox -e py311,mypy,ruff check/format,docs-furoall green; the strengthened tests confirmed red against unfixedtabs.py.