rust-lang / rust-lang/mdBook

Use HTML <q> Tag Instead of Curly Quotes for Smart Punctuation

Open
#2,723 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-HTML A-Localization C-enhancement
Dominant language
Rust
Stars
22.2k
Forks
1.9k
Avg merge
2d 21h
Merged PRs (30d)
12

Description

Problem

Currently, when enabling output.html.smart-punctuation, double quotes in the HTML output are rendered as curly quotes. However, these curly quotes are not appropriate or standard for many languages - as detailed in this overview.

Proposed Solution

Instead of replacing straight double quotes with curly quotes when smart-punctuation is enabled, the renderer should use the HTML <q> tag. This would allow browsers to render quotation marks according to the book's language metadata in book.toml with fallback options to the user's locale or browser language settings.

Notes

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the HTML renderer implementation for output.html.smart-punctuation and trace how double quotes are transformed. Check how book.toml language metadata is available to generated HTML. Done means smart punctuation emits the HTML q element and quotation rendering can follow the book language or documented browser fallbacks.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.