mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch 'stable' into 1.5-release
This commit is contained in:
commit
f43a02ca27
1
CHANGES
1
CHANGES
@ -283,6 +283,7 @@ Bugs fixed
|
||||
* #3015: fix a broken test on Windows.
|
||||
* #1843: Fix documentation of descriptor classes that have a custom metaclass.
|
||||
Thanks to Erik Bray.
|
||||
* #3190: util.split_docinfo fails to parse multi-line field bodies
|
||||
|
||||
Release 1.4.9 (released Nov 23, 2016)
|
||||
=====================================
|
||||
|
@ -506,7 +506,7 @@ def encode_uri(uri):
|
||||
|
||||
|
||||
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)
|
||||
if len(result) == 1:
|
||||
return '', result[0]
|
||||
|
@ -41,3 +41,8 @@ def test_splitdocinfo():
|
||||
docinfo, content = split_docinfo(source)
|
||||
assert docinfo == ':author: Georg Brandl\n:title: Manual of Sphinx\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'
|
||||
|
Loading…
Reference in New Issue
Block a user