yaml output: Avoid linebreaks in dumps

Issue #106 resolved
dbacc created an issue

the standard options of yaml.dump set the width of lines to a certain value. This might lead to artificial (non-yaml conform?!) newlines.

I would suggest to add width=float("inf") as argument to yaml.dump

--- a/pybtex/database/output/bibyaml.py
+++ b/pybtex/database/output/bibyaml.py
@@ -81,6 +81,7 @@ class Writer(BaseWriter):
             default_flow_style=False,
             indent=4,
             Dumper=OrderedDictSafeDumper,
+            width=float("inf")
         )

     def write_stream(self, bib_data, stream):

Comments (3)

  1. Andrey Golovizin

    Checked the YAML spec and found out that line breaks in quoted lines are automatically replaced with spaces (http://www.yaml.org/spec/1.2/spec.html, look for "flow folding"). So there is nothing wrong with those line breaks. It also seems more readable to me. Do you think it is a problem?

  2. Log in to comment