Skip to content

Commit

Permalink
fix text block dump, fixes #10
Browse files Browse the repository at this point in the history
  • Loading branch information
lbovet committed Sep 11, 2021
1 parent 23b3e88 commit 7ecc3b7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ MANIFEST
# Per-project virtualenvs
.venv*/
.conda*/
dist
2 changes: 1 addition & 1 deletion src/yglu/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def construct_scalar(self, node):
)

if node.style == "|" and isinstance(node.value, str):
ret_val = PreservedScalarString(node.value)
ret_val = SimpleString(node.value)
elif bool(self._preserve_quotes) and isinstance(node.value, str):
if node.style == "'":
ret_val = SingleQuotedScalarString(node.value)
Expand Down
13 changes: 13 additions & 0 deletions tests/samples/strings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# input
a: hello
b: 'foo:'
c: "!bar"
d: |-
hello
world
---

a: hello
b: 'foo:'
c: "!bar"
d: "hello\nworld"
1 change: 1 addition & 0 deletions tests/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def test_no_tags():
assert data["key2"] == "item2"
assert data["list"][1] == 2
assert data["key4"]["key5"] == "item5"
assert "item6" in data["key4"]["key6"]


def test_invisible():
Expand Down

0 comments on commit 7ecc3b7

Please sign in to comment.