mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-09-03 20:52:55 -05:00
Merge branch 'stable' into 1.5-release
This commit is contained in:
@@ -283,6 +283,7 @@ Bugs fixed
|
|||||||
* #3015: fix a broken test on Windows.
|
* #3015: fix a broken test on Windows.
|
||||||
* #1843: Fix documentation of descriptor classes that have a custom metaclass.
|
* #1843: Fix documentation of descriptor classes that have a custom metaclass.
|
||||||
Thanks to Erik Bray.
|
Thanks to Erik Bray.
|
||||||
|
* #3190: util.split_docinfo fails to parse multi-line field bodies
|
||||||
|
|
||||||
Release 1.4.9 (released Nov 23, 2016)
|
Release 1.4.9 (released Nov 23, 2016)
|
||||||
=====================================
|
=====================================
|
||||||
|
|||||||
@@ -506,7 +506,7 @@ def encode_uri(uri):
|
|||||||
|
|
||||||
|
|
||||||
def split_docinfo(text):
|
def split_docinfo(text):
|
||||||
docinfo_re = re.compile('\A((?:\s*:\w+:.*?\n)+)', re.M)
|
docinfo_re = re.compile('\A((?:\s*:\w+:.*?\n(?:[ \t]+.*?\n)*)+)', re.M)
|
||||||
result = docinfo_re.split(text, 1)
|
result = docinfo_re.split(text, 1)
|
||||||
if len(result) == 1:
|
if len(result) == 1:
|
||||||
return '', result[0]
|
return '', result[0]
|
||||||
|
|||||||
@@ -41,3 +41,8 @@ def test_splitdocinfo():
|
|||||||
docinfo, content = split_docinfo(source)
|
docinfo, content = split_docinfo(source)
|
||||||
assert docinfo == ':author: Georg Brandl\n:title: Manual of Sphinx\n'
|
assert docinfo == ':author: Georg Brandl\n:title: Manual of Sphinx\n'
|
||||||
assert content == '\nHello world.\n'
|
assert content == '\nHello world.\n'
|
||||||
|
|
||||||
|
source = ":multiline: one\n\ttwo\n\tthree\n\nHello world.\n"
|
||||||
|
docinfo, content = split_docinfo(source)
|
||||||
|
assert docinfo == ":multiline: one\n\ttwo\n\tthree\n"
|
||||||
|
assert content == '\nHello world.\n'
|
||||||
|
|||||||
Reference in New Issue
Block a user