|
From: <mi...@us...> - 2021-10-30 22:59:24
|
Revision: 8871
http://sourceforge.net/p/docutils/code/8871
Author: milde
Date: 2021-10-30 22:59:21 +0000 (Sat, 30 Oct 2021)
Log Message:
-----------
Small fixes for 0.18.1.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/docutils/writers/html5_polyglot/math.css
trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-10-29 09:39:37 UTC (rev 8870)
+++ trunk/docutils/HISTORY.txt 2021-10-30 22:59:21 UTC (rev 8871)
@@ -14,8 +14,14 @@
Changes Since 0.18
==================
-.
+* docutils/writers/_html_base.py
+ - fixed handling of ``footnote_backlinks==False`` (report Alan G Isaac).
+
+* docutils/writers/html5_polyglot/math.css
+
+ - fixed typo (bug #432).
+
Release 0.18 (2021-10-26)
=========================
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2021-10-29 09:39:37 UTC (rev 8870)
+++ trunk/docutils/RELEASE-NOTES.txt 2021-10-30 22:59:21 UTC (rev 8871)
@@ -153,6 +153,10 @@
* Removed files:
``iepngfix.htc`` and ``blank.gif`` (IE 6 workaround for `s5_html`).
+* Removed sub-module:
+ ``parsers.rst.directives.html``
+ (Meta directive moved to ``parsers.rst.directives.misc``.)
+
* Removed function: ``utils.unique_combinations``
(obsoleted by ``itertools.combinations``).
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2021-10-29 09:39:37 UTC (rev 8870)
+++ trunk/docutils/docutils/writers/_html_base.py 2021-10-30 22:59:21 UTC (rev 8871)
@@ -1101,7 +1101,9 @@
' href="#%s">' % backrefs[0])
def depart_label(self, node):
- backrefs = node.parent.get('backrefs', [])
+ backrefs = []
+ if self.settings.footnote_backlinks:
+ backrefs = node.parent.get('backrefs', backrefs)
if len(backrefs) == 1:
self.body.append('</a>')
self.body.append('<span class="fn-bracket">]</span></span>\n')
Modified: trunk/docutils/docutils/writers/html5_polyglot/math.css
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/math.css 2021-10-29 09:39:37 UTC (rev 8870)
+++ trunk/docutils/docutils/writers/html5_polyglot/math.css 2021-10-30 22:59:21 UTC (rev 8871)
@@ -312,7 +312,7 @@
font-variant: small-caps;
}
span.textsl {
- font-style: obligue;
+ font-style: oblique;
}
/* Colors */
Modified: trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
===================================================================
--- trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2021-10-29 09:39:37 UTC (rev 8870)
+++ trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2021-10-30 22:59:21 UTC (rev 8871)
@@ -657,6 +657,71 @@
"""],
])
+
+totest['no backlinks'] = ({'footnote_backlinks': False,
+ 'stylesheet_path': '',
+ 'embed_stylesheet': 0}, [
+
+["""\
+Two footnotes [#f1]_ [#f2]_ and two citations [once]_ [twice]_.
+
+The latter are referenced a second time [#f2]_ [twice]_.
+
+.. [#f1] referenced once
+.. [#f2] referenced twice
+.. [once] citation referenced once
+.. [twice] citation referenced twice
+""",
+"""\
+{'fragment': '''\
+<p>Two footnotes <a class="footnote-reference brackets" href="#f1" id="footnote-reference-1" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a> <a class="footnote-reference brackets" href="#f2" id="footnote-reference-2" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a> and two citations <a class="citation-reference" href="#once" id="citation-reference-1" role="doc-biblioref">[once]</a> <a class="citation-reference" href="#twice" id="citation-reference-2" role="doc-biblioref">[twice]</a>.</p>
+<p>The latter are referenced a second time <a class="footnote-reference brackets" href="#f2" id="footnote-reference-3" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a> <a class="citation-reference" href="#twice" id="citation-reference-3" role="doc-biblioref">[twice]</a>.</p>
+<aside class="footnote brackets" id="f1" role="note">
+<span class="label"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></span>
+<p>referenced once</p>
+</aside>
+<aside class="footnote brackets" id="f2" role="note">
+<span class="label"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></span>
+<p>referenced twice</p>
+</aside>
+<div role="list" class="citation-list">
+<div class="citation" id="once" role="doc-biblioentry">
+<span class="label"><span class="fn-bracket">[</span>once<span class="fn-bracket">]</span></span>
+<p>citation referenced once</p>
+</div>
+<div class="citation" id="twice" role="doc-biblioentry">
+<span class="label"><span class="fn-bracket">[</span>twice<span class="fn-bracket">]</span></span>
+<p>citation referenced twice</p>
+</div>
+</div>\\n''',
+ 'html_body': '''\
+<main>
+<p>Two footnotes <a class="footnote-reference brackets" href="#f1" id="footnote-reference-1" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a> <a class="footnote-reference brackets" href="#f2" id="footnote-reference-2" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a> and two citations <a class="citation-reference" href="#once" id="citation-reference-1" role="doc-biblioref">[once]</a> <a class="citation-reference" href="#twice" id="citation-reference-2" role="doc-biblioref">[twice]</a>.</p>
+<p>The latter are referenced a second time <a class="footnote-reference brackets" href="#f2" id="footnote-reference-3" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a> <a class="citation-reference" href="#twice" id="citation-reference-3" role="doc-biblioref">[twice]</a>.</p>
+<aside class="footnote brackets" id="f1" role="note">
+<span class="label"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></span>
+<p>referenced once</p>
+</aside>
+<aside class="footnote brackets" id="f2" role="note">
+<span class="label"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></span>
+<p>referenced twice</p>
+</aside>
+<div role="list" class="citation-list">
+<div class="citation" id="once" role="doc-biblioentry">
+<span class="label"><span class="fn-bracket">[</span>once<span class="fn-bracket">]</span></span>
+<p>citation referenced once</p>
+</div>
+<div class="citation" id="twice" role="doc-biblioentry">
+<span class="label"><span class="fn-bracket">[</span>twice<span class="fn-bracket">]</span></span>
+<p>citation referenced twice</p>
+</div>
+</div>
+</main>\\n''',
+ 'html_head': '''...<title><string></title>\\n'''}
+"""],
+])
+
+
if __name__ == '__main__':
import unittest
unittest.main(defaultTest='suite')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|