Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix alt and caption handling in Sphinx directives#29689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
timhoffm merged 1 commit intomatplotlib:mainfromQuLogic:alt-plot
Feb 28, 2025

Conversation

QuLogic
Copy link
Member

@QuLogicQuLogic commentedFeb 27, 2025
edited
Loading

PR summary

We currently template new reST to be re-parsed after the plot is created, but incorrectly copied thealt andcaption values when they were wrapped.
In the future, we should probably drop this template and directly create the nodes we need, but I assume thatTEMPLATE is not private right now for the purpose of letting people modify it.

Additionally, changefigmpl to use Sphinx/docutils' tag creation functions. These functions correctly escape attributes and so fixes invalid HTML when alt text contains quotes. I also dropped some attributes if they were empty (e.g., we no longer getstyle="" if those aren't specified.)
For example, this is broken on thedark colour map image which has quoted colour map names in the alt text.

Fixes#29649

PR checklist

story645 reacted with heart emoji
We currently template new reST to be re-parsed after the plot iscreated, but incorrectly copied the `alt` and `caption` values when theywere wrapped.Additionally, change `figmpl` to use Sphinx/docutils' tag creationfunctions. These functions correctly escape attributes and so fixesinvalid HTML when alt text contains quotes.
@timhoffmtimhoffm merged commited3b739 intomatplotlib:mainFeb 28, 2025
40 of 41 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestFeb 28, 2025
@QuLogicQuLogic deleted the alt-plot branchFebruary 28, 2025 22:08
timhoffm added a commit that referenced this pull requestMar 1, 2025
…689-on-v3.10.xBackport PR#29689 on branch v3.10.x (Fix alt and caption handling in Sphinx directives)
@ksundenksunden mentioned this pull requestMay 9, 2025
5 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell approved these changes

@story645story645story645 approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.10.3
Development

Successfully merging this pull request may close these issues.

[Bug]: plot directive not handling indentation of long option strings
4 participants
@QuLogic@tacaswell@story645@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp