mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '1.8'
This commit is contained in:
@@ -12,6 +12,8 @@ import re
|
||||
|
||||
import pytest
|
||||
|
||||
from sphinx.builders.htmlhelp import chm_htmlescape
|
||||
|
||||
from sphinx.builders.htmlhelp import default_htmlhelp_basename
|
||||
from sphinx.config import Config
|
||||
|
||||
@@ -45,3 +47,17 @@ def test_chm(app):
|
||||
data = f.read()
|
||||
m = re.search(br'&#[xX][0-9a-fA-F]+;', data)
|
||||
assert m is None, 'Hex escaping exists in .hhk file: ' + str(m.group(0))
|
||||
|
||||
|
||||
def test_chm_htmlescape():
|
||||
assert chm_htmlescape('Hello world') == 'Hello world'
|
||||
assert chm_htmlescape(u'Unicode 文字') == u'Unicode 文字'
|
||||
assert chm_htmlescape('E') == '&#x45'
|
||||
|
||||
assert chm_htmlescape('<Hello> "world"') == '<Hello> "world"'
|
||||
assert chm_htmlescape('<Hello> "world"', True) == '<Hello> "world"'
|
||||
assert chm_htmlescape('<Hello> "world"', False) == '<Hello> "world"'
|
||||
|
||||
assert chm_htmlescape("Hello 'world'") == "Hello 'world'"
|
||||
assert chm_htmlescape("Hello 'world'", True) == "Hello 'world'"
|
||||
assert chm_htmlescape("Hello 'world'", False) == "Hello 'world'"
|
||||
|
||||
Reference in New Issue
Block a user