mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
fix html entity to fix epub error
This commit is contained in:
parent
8f162a132e
commit
90b3c79895
4
doc/_templates/index.html
vendored
4
doc/_templates/index.html
vendored
@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
<div class="quotebar">
|
<div class="quotebar">
|
||||||
<p><em>{%trans%}What users say:{%endtrans%}</em></p>
|
<p><em>{%trans%}What users say:{%endtrans%}</em></p>
|
||||||
<p>{%trans%}“Cheers for a great tool that actually makes programmers <b>want</b>
|
<p>{%trans%}“Cheers for a great tool that actually makes programmers <b>want</b>
|
||||||
to write documentation!”{%endtrans%}</p>
|
to write documentation!“{%endtrans%}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>{%trans%}
|
<p>{%trans%}
|
||||||
|
4
doc/_themes/sphinx13/layout.html
vendored
4
doc/_themes/sphinx13/layout.html
vendored
@ -57,8 +57,8 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block rootrellink %}
|
{% block rootrellink %}
|
||||||
<li><a href="{{ pathto('index') }}">Sphinx home</a> |</li>
|
<li><a href="{{ pathto('index') }}">Sphinx home</a> |</li>
|
||||||
<li><a href="{{ pathto('contents') }}">Documentation</a> »</li>
|
<li><a href="{{ pathto('contents') }}">Documentation</a> »</li>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block header %}
|
{% block header %}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"http://www.w3.org/TR/html4/frameset.dtd">
|
"http://www.w3.org/TR/html4/frameset.dtd">
|
||||||
<html{% if language is not none %} lang="{{ language }}"{% endif %}>
|
<html{% if language is not none %} lang="{{ language }}"{% endif %}>
|
||||||
<head>
|
<head>
|
||||||
<title>{% trans version=version|e, docstitle=docstitle|e %}Changes in Version {{ version }} — {{ docstitle }}{% endtrans %}</title>
|
<title>{% trans version=version|e, docstitle=docstitle|e %}Changes in Version {{ version }} — {{ docstitle }}{% endtrans %}</title>
|
||||||
</head>
|
</head>
|
||||||
<frameset cols="45%,*">
|
<frameset cols="45%,*">
|
||||||
<frame name="main" src="changes.html">
|
<frame name="main" src="changes.html">
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"http://www.w3.org/TR/html4/loose.dtd">
|
"http://www.w3.org/TR/html4/loose.dtd">
|
||||||
<html{% if language is not none %} lang="{{ language }}"{% endif %}>
|
<html{% if language is not none %} lang="{{ language }}"{% endif %}>
|
||||||
<head>
|
<head>
|
||||||
<title>{% trans filename=filename, docstitle=docstitle|e %}{{ filename }} — {{ docstitle }}{% endtrans %}</title>
|
<title>{% trans filename=filename, docstitle=docstitle|e %}{{ filename }} — {{ docstitle }}{% endtrans %}</title>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.hl { background-color: yellow }
|
.hl { background-color: yellow }
|
||||||
</style>
|
</style>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="default.css">
|
<link rel="stylesheet" href="default.css">
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<title>{% trans version=version|e, docstitle=docstitle|e %}Changes in Version {{ version }} — {{ docstitle }}{% endtrans %}</title>
|
<title>{% trans version=version|e, docstitle=docstitle|e %}Changes in Version {{ version }} — {{ docstitle }}{% endtrans %}</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="document">
|
<div class="document">
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
<table class="indextable modindextable" cellspacing="0" cellpadding="2">
|
<table class="indextable modindextable" cellspacing="0" cellpadding="2">
|
||||||
{%- for letter, entries in content %}
|
{%- for letter, entries in content %}
|
||||||
<tr class="pcap"><td></td><td> </td><td></td></tr>
|
<tr class="pcap"><td></td><td> </td><td></td></tr>
|
||||||
<tr class="cap" id="cap-{{ letter }}"><td></td><td>
|
<tr class="cap" id="cap-{{ letter }}"><td></td><td>
|
||||||
<strong>{{ letter }}</strong></td><td></td></tr>
|
<strong>{{ letter }}</strong></td><td></td></tr>
|
||||||
{%- for (name, grouptype, page, anchor, extra, qualifier, description)
|
{%- for (name, grouptype, page, anchor, extra, qualifier, description)
|
||||||
@ -42,7 +42,7 @@
|
|||||||
<img src="{{ pathto('_static/minus.png', 1) }}" class="toggler"
|
<img src="{{ pathto('_static/minus.png', 1) }}" class="toggler"
|
||||||
id="toggle-{{ groupid.next() }}" style="display: none" alt="-" />
|
id="toggle-{{ groupid.next() }}" style="display: none" alt="-" />
|
||||||
{%- endif %}</td>
|
{%- endif %}</td>
|
||||||
<td>{% if grouptype == 2 %} {% endif %}
|
<td>{% if grouptype == 2 %}   {% endif %}
|
||||||
{% if page %}<a href="{{ pathto(page) }}#{{ anchor }}">{% endif -%}
|
{% if page %}<a href="{{ pathto(page) }}#{{ anchor }}">{% endif -%}
|
||||||
<code class="xref">{{ name|e }}</code>
|
<code class="xref">{{ name|e }}</code>
|
||||||
{%- if page %}</a>{% endif %}
|
{%- if page %}</a>{% endif %}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
{%- endblock %}
|
{%- endblock %}
|
||||||
{%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %}
|
{%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %}
|
||||||
{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
|
{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
|
||||||
{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and
|
{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and
|
||||||
(sidebars != []) %}
|
(sidebars != []) %}
|
||||||
@ -19,7 +19,7 @@
|
|||||||
{# XXX necessary? #}
|
{# XXX necessary? #}
|
||||||
{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
|
{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
|
||||||
{%- if not embedded and docstitle %}
|
{%- if not embedded and docstitle %}
|
||||||
{%- set titlesuffix = " — "|safe + docstitle|e %}
|
{%- set titlesuffix = " — "|safe + docstitle|e %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- set titlesuffix = "" %}
|
{%- set titlesuffix = "" %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
@ -186,9 +186,9 @@
|
|||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
{%- if show_copyright %}
|
{%- if show_copyright %}
|
||||||
{%- if hasdoc('copyright') %}
|
{%- if hasdoc('copyright') %}
|
||||||
{% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
|
{% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %}
|
{% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if last_updated %}
|
{%- if last_updated %}
|
||||||
|
@ -105,7 +105,7 @@ decade_abbr_re = re.compile(r"""\b'(?=\d{2}s)""")
|
|||||||
opening_double_quotes_regex = re.compile(r"""
|
opening_double_quotes_regex = re.compile(r"""
|
||||||
(
|
(
|
||||||
\s | # a whitespace char, or
|
\s | # a whitespace char, or
|
||||||
| # a non-breaking space entity, or
|
  | # a non-breaking space entity, or
|
||||||
-- | # dashes, or
|
-- | # dashes, or
|
||||||
&[mn]dash; | # named dash entities
|
&[mn]dash; | # named dash entities
|
||||||
%s | # or decimal entities
|
%s | # or decimal entities
|
||||||
@ -131,7 +131,7 @@ closing_double_quotes_regex_2 = re.compile(r"""
|
|||||||
opening_single_quotes_regex = re.compile(r"""
|
opening_single_quotes_regex = re.compile(r"""
|
||||||
(
|
(
|
||||||
\s | # a whitespace char, or
|
\s | # a whitespace char, or
|
||||||
| # a non-breaking space entity, or
|
  | # a non-breaking space entity, or
|
||||||
-- | # dashes, or
|
-- | # dashes, or
|
||||||
&[mn]dash; | # named dash entities
|
&[mn]dash; | # named dash entities
|
||||||
%s | # or decimal entities
|
%s | # or decimal entities
|
||||||
|
@ -545,7 +545,7 @@ class HTMLTranslator(BaseTranslator):
|
|||||||
self.body.append(token)
|
self.body.append(token)
|
||||||
else:
|
else:
|
||||||
# protect runs of multiple spaces; the last one can wrap
|
# protect runs of multiple spaces; the last one can wrap
|
||||||
self.body.append(' ' * (len(token)-1) + ' ')
|
self.body.append(' ' * (len(token)-1) + ' ')
|
||||||
else:
|
else:
|
||||||
if self.in_mailto and self.settings.cloak_email_addresses:
|
if self.in_mailto and self.settings.cloak_email_addresses:
|
||||||
encoded = self.cloak_email(encoded)
|
encoded = self.cloak_email(encoded)
|
||||||
|
@ -92,7 +92,7 @@ def verify(rst, html_expected, latex_expected):
|
|||||||
def test_inline():
|
def test_inline():
|
||||||
# correct interpretation of code with whitespace
|
# correct interpretation of code with whitespace
|
||||||
_html = ('<p><code class="(samp )?docutils literal"><span class="pre">'
|
_html = ('<p><code class="(samp )?docutils literal"><span class="pre">'
|
||||||
'code</span> <span class="pre">sample</span></code></p>')
|
'code</span>   <span class="pre">sample</span></code></p>')
|
||||||
yield verify_re, '``code sample``', _html, r'\\sphinxcode{code sample}'
|
yield verify_re, '``code sample``', _html, r'\\sphinxcode{code sample}'
|
||||||
yield verify_re, ':samp:`code sample`', _html, r'\\sphinxcode{code sample}'
|
yield verify_re, ':samp:`code sample`', _html, r'\\sphinxcode{code sample}'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user