Skip to content

smartquotes extension doesn't honor localized rules #806

Open

Description

@dbitouze

What version of myst-parser are you using?

2.0.0

What version dependencies are you using?

sphinx

What operating system are you using?

Linux

Describe the Bug

When the MyST's extension smartquotes is enabled, e.g. the double quotes are automatically converted to their opening/closing variants, but only in their English form, whatever the language specified in the conf.py file.

More specifically, with language=fr in conf.py and the MyST's extension smartquotes:

  • enabled,"Test" is converted into “Test”,
  • disabled, "Test" is converted into « Test ».

Expected Behavior

The MyST's extension smartquotes should honor localized rules.

To Reproduce

Create a minimal Sphinx documentation project, with the following conf.py file:

# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'Test smartquotes'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

source_suffix = ['.rst', '.md']

# smartquotes = True

extensions = [
    'myst_parser',
]

myst_enable_extensions = [
    # "smartquotes",
]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

language = 'fr'

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'alabaster'
html_static_path = ['_static']

and the following index.md file:

# Welcome to Test's documentation!

"Test"

Activity

  1. added
    bug
    on Sep 7, 2023
  2. changed the title [-]smartquotes extension doesn't honor localized rules[/-] [+]`smartquotes` extension doesn't honor localized rules[/+] on Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions