Skip to content

Commit

Permalink
Merge pull request #25 from hackebrot/trim-trailing-whitespace-in-var…
Browse files Browse the repository at this point in the history
…iable

Trim trailing whitespace in variable
  • Loading branch information
hackebrot authored Jul 22, 2019
2 parents ac60c85 + 34bd73a commit 6fb5a16
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/poyo/patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

_INDENT = r"(?P<indent>^ *)"
_INDENT_MATCH = r"(?P=indent)"
_VAR = r"(?P<variable>.+?):"
_VAR = r"(?P<variable>.+?)\s*:"
_VALUE = r"(?P<value>(?:(?P<q2>['\"]).*?(?P=q2))|[^#]+?)"
_STR_VALUE = r"((?:(?P<q2>['\"]).*?(?P=q2))|[^#]+?)"
_NEWLINE = r"$\n"
Expand Down
1 change: 1 addition & 0 deletions tests/foobar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6fb5a16

Please # to comment.