Skip to content

Prevent smartquotes from rewriting option dashes.#101

Open
mmulqueen wants to merge 1 commit into
sphinx-doc:mainfrom
mmulqueen:main
Open

Prevent smartquotes from rewriting option dashes.#101
mmulqueen wants to merge 1 commit into
sphinx-doc:mainfrom
mmulqueen:main

Conversation

@mmulqueen

Copy link
Copy Markdown

Option names in parser-supplied text - descriptions, epilogs, and help strings - had their leading -- rewritten to an en dash in the rendered HTML, so a flag documented as --text displayed as –text. Readers copying the option out of the docs got something the command line no longer accepts.

Each --option-style token is now wrapped in an inline node that opts out via support_smartquotes, so smart quotes skips it while surrounding prose keeps normal typography.

Fixes #100

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 51.16279% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.71%. Comparing base (f918d4e) to head (5b6de3f).

Files with missing lines Patch % Lines
sphinxarg/ext.py 59.45% 13 Missing and 2 partials ⚠️
test/sample-directive-smartquotes.py 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #101      +/-   ##
==========================================
+ Coverage   50.15%   50.71%   +0.56%     
==========================================
  Files          18       19       +1     
  Lines        1292     1329      +37     
  Branches      262      270       +8     
==========================================
+ Hits          648      674      +26     
- Misses        600      610      +10     
- Partials       44       45       +1     
Flag Coverage Δ
unittests 50.48% <51.16%> (+0.56%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Smart quotes rewrites --option mentions in help text as an en dash

1 participant