Skip to content

Commit

Permalink
Quote strings with # in them, so that they won't end up as comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mk-fg committed Apr 2, 2020
1 parent 170771c commit f904b96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyaml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def represent_stringish(dumper, data):
style = dumper.pyaml_string_val_style
if not style:
style = 'plain'
if '\n' in data or not data or data == '-' or data[0] in '!&*[':
if '\n' in data or not data or data == '-' or data[0] in '!&*[' or '#' in data:
style = 'literal'
if '\n' in data[:-1]:
for line in data.splitlines():
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
setup(

name = 'pyaml',
version = '20.3.1',
version = '20.4.0',
author = 'Mike Kazantsev',
author_email = 'mk.fraggod@gmail.com',
license = 'WTFPL',
Expand Down

0 comments on commit f904b96

Please sign in to comment.