Repository: sphinx-doc/sphinx

Issue:
util.split_docinfo fails to parse multi-line field bodies.
From [the reStructuredText Markup Specification](http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html), field lists, which are used to define docinfo, allow multi-line field bodies, but util.split_docinfo seems not to consider such case.

For example, 

```
:fieldname: one
    two
    three

Hello world.
```

is expected to be split to

~~~
:fieldname: one
    two
    three
~~~

and

~~~

Hello world.
~~~

but util.split_docinfo returns 

~~~
:fieldname: one
~~~

and

~~~
    two
    three

Hello world.
~~~



Discussion:

Patch:
diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py
index 9c5365aa7..573882418 100644
--- a/sphinx/util/__init__.py
+++ b/sphinx/util/__init__.py
@@ -545,7 +545,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]


Test patch:
diff --git a/tests/test_util.py b/tests/test_util.py
index dbecfb1a2..d97329668 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -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'