mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
i18n: disable default smartquotes for zh_CN and zh_TW (#12875)
This commit is contained in:
@@ -17,6 +17,7 @@ Incompatible changes
|
||||
Code-blokcs are unchanged as FreeMono is now loaded with ``Scale=0.9``.
|
||||
An adjustement to existing projects is needed only if they used a custom
|
||||
:ref:`fontpkg` configuration and did not set :ref:`fvset`.
|
||||
* #12875: Disable smartquotes for languages: ``zh_CN`` and ``zh_TW`` by default.
|
||||
|
||||
Deprecated
|
||||
----------
|
||||
|
||||
@@ -271,7 +271,7 @@ class Config:
|
||||
'smartquotes': _Opt(True, 'env', ()),
|
||||
'smartquotes_action': _Opt('qDe', 'env', ()),
|
||||
'smartquotes_excludes': _Opt(
|
||||
{'languages': ['ja'], 'builders': ['man', 'text']}, 'env', ()),
|
||||
{'languages': ['ja', 'zh_CN', 'zh_TW'], 'builders': ['man', 'text']}, 'env', ()),
|
||||
'option_emphasise_placeholders': _Opt(False, 'env', ()),
|
||||
}
|
||||
|
||||
|
||||
@@ -86,6 +86,32 @@ def test_ja_html_builder(app):
|
||||
assert '<p>-- "Sphinx" is a tool that makes it easy ...</p>' in content
|
||||
|
||||
|
||||
@pytest.mark.sphinx(
|
||||
'html',
|
||||
testroot='smartquotes',
|
||||
freshenv=True,
|
||||
confoverrides={'language': 'zh_CN'},
|
||||
)
|
||||
def test_zh_cn_html_builder(app):
|
||||
app.build()
|
||||
|
||||
content = (app.outdir / 'index.html').read_text(encoding='utf8')
|
||||
assert '<p>-- "Sphinx" is a tool that makes it easy ...</p>' in content
|
||||
|
||||
|
||||
@pytest.mark.sphinx(
|
||||
'html',
|
||||
testroot='smartquotes',
|
||||
freshenv=True,
|
||||
confoverrides={'language': 'zh_TW'},
|
||||
)
|
||||
def test_zh_tw_html_builder(app):
|
||||
app.build()
|
||||
|
||||
content = (app.outdir / 'index.html').read_text(encoding='utf8')
|
||||
assert '<p>-- "Sphinx" is a tool that makes it easy ...</p>' in content
|
||||
|
||||
|
||||
@pytest.mark.sphinx(
|
||||
'html',
|
||||
testroot='smartquotes',
|
||||
|
||||
Reference in New Issue
Block a user