diff --git a/README.rst b/README.rst index d5d82e9..8f203da 100644 --- a/README.rst +++ b/README.rst @@ -88,6 +88,7 @@ Example 'some:int': 1000000 foo: "hallo #welt" #Inline comment :) trueish: Falseeeeeee + blog : raphael.codes relative-root: / # web app root path (default: '') lektor: 0.0.0.0:5000 # local build doc_tools: @@ -125,6 +126,7 @@ Example u'some:int': 1000000, u'foo': u'hallo #welt', u'trueish': u'Falseeeeeee', + u'blog': u'raphael.codes', u'doc_tools': [u'mkdocs', u'sphinx', None], }, u'zZz': True, diff --git a/src/poyo/patterns.py b/src/poyo/patterns.py index 977ccba..4859682 100644 --- a/src/poyo/patterns.py +++ b/src/poyo/patterns.py @@ -4,7 +4,7 @@ _INDENT = r"(?P^ *)" _INDENT_MATCH = r"(?P=indent)" -_VAR = r"(?P.+?):" +_VAR = r"(?P.+?)\s*:" _VALUE = r"(?P(?:(?P['\"]).*?(?P=q2))|[^#]+?)" _STR_VALUE = r"((?:(?P['\"]).*?(?P=q2))|[^#]+?)" _NEWLINE = r"$\n" diff --git a/tests/foobar.yml b/tests/foobar.yml index 7b13ad5..a1be197 100644 --- a/tests/foobar.yml +++ b/tests/foobar.yml @@ -11,6 +11,7 @@ default_context: # foobar 'some:int': 1000000 foo: "hallo #welt" #Inline comment :) trueish: Falseeeeeee + blog : raphael.codes relative-root: / # web app root path (default: '') lektor: 0.0.0.0:5000 # local build doc_tools: diff --git a/tests/test_parser.py b/tests/test_parser.py index 916a588..d062389 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -27,6 +27,7 @@ def test_parse_string(string_data): u"some:int": 1000000, u"foo": u"hallo #welt", u"trueish": u"Falseeeeeee", + u"blog": u"raphael.codes", u"doc_tools": [u"mkdocs", u"sphinx", None], }, u"zZz": True,