Merge branch 'stable'

This commit is contained in:
Takeshi KOMIYA 2016-07-13 21:29:47 +09:00
commit 1dd249dd8d
4 changed files with 25 additions and 7 deletions

12
CHANGES
View File

@ -78,9 +78,16 @@ Documentation
------------- -------------
Release 1.4.5 (in development) Release 1.4.6 (in development)
============================== ==============================
Bugs fixed
----------
Release 1.4.5 (released Jul 13, 2016)
=====================================
Incompatible changes Incompatible changes
-------------------- --------------------
@ -103,6 +110,7 @@ Features added
Bugs fixed Bugs fixed
---------- ----------
* jsdump fix for python 3: fixes the HTML search on python > 3
* #2676: (latex) Error with verbatim text in captions since Sphinx 1.4.4 * #2676: (latex) Error with verbatim text in captions since Sphinx 1.4.4
* #2629: memoir class crashes LaTeX. Fixed ``by latex_keep_old_macro_names=False`` (ref 2675) * #2629: memoir class crashes LaTeX. Fixed ``by latex_keep_old_macro_names=False`` (ref 2675)
* #2684: `sphinx.ext.intersphinx` crashes with six-1.4.1 * #2684: `sphinx.ext.intersphinx` crashes with six-1.4.1
@ -126,6 +134,8 @@ Bugs fixed
* #2723: extra spaces in latex pdf output from multirow cell * #2723: extra spaces in latex pdf output from multirow cell
* #2735: latexpdf ``Underfull \hbox (badness 10000)`` warnings from title page * #2735: latexpdf ``Underfull \hbox (badness 10000)`` warnings from title page
* #2667: latex crashes if resized images appeared in section title * #2667: latex crashes if resized images appeared in section title
* #2763: (html) Provide default value for required ``alt`` attribute for image
tags of SVG source, required to validate and now consistent w/ other formats.
Release 1.4.4 (released Jun 12, 2016) Release 1.4.4 (released Jun 12, 2016)

View File

@ -19,7 +19,7 @@ from sphinx.util.pycompat import u
_str_re = re.compile(r'"(\\\\|\\"|[^"])*"') _str_re = re.compile(r'"(\\\\|\\"|[^"])*"')
_int_re = re.compile(r'\d+') _int_re = re.compile(r'\d+')
_name_re = re.compile(r'[a-zA-Z]\w*') _name_re = re.compile(r'[a-zA-Z]\w*')
_nameonly_re = re.compile(r'[a-zA-Z]\w*$') _nameonly_re = re.compile(r'[a-zA-Z_][a-zA-Z0-9_]*$')
# escape \, ", control characters and everything outside ASCII # escape \, ", control characters and everything outside ASCII
ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])') ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])')

View File

@ -458,15 +458,14 @@ class HTMLTranslator(BaseTranslator):
node['uri'] = posixpath.join(self.builder.imgpath, node['uri'] = posixpath.join(self.builder.imgpath,
self.builder.images[olduri]) self.builder.images[olduri])
if node['uri'].lower().endswith('svg') or \ uri = node['uri']
node['uri'].lower().endswith('svgz'): if uri.lower().endswith('svg') or uri.lower().endswith('svgz'):
atts = {'src': node['uri']} atts = {'src': uri}
if 'width' in node: if 'width' in node:
atts['width'] = node['width'] atts['width'] = node['width']
if 'height' in node: if 'height' in node:
atts['height'] = node['height'] atts['height'] = node['height']
if 'alt' in node: atts['alt'] = node.get('alt', uri)
atts['alt'] = node['alt']
if 'align' in node: if 'align' in node:
self.body.append('<div align="%s" class="align-%s">' % self.body.append('<div align="%s" class="align-%s">' %
(node['align'], node['align'])) (node['align'], node['align']))

View File

@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
def test_jsdump():
from sphinx.util.jsdump import dumps
assert dumps({'1a': 1}) == '{"1a":1}'
assert dumps({'a1': 1}) == '{a1:1}'
assert dumps({u'a\xe8': 1}) == '{"a\\u00e8":1}'