diff --git a/mdformat_frontmatter/plugin.py b/mdformat_frontmatter/plugin.py index 042a2ce..8518bb9 100644 --- a/mdformat_frontmatter/plugin.py +++ b/mdformat_frontmatter/plugin.py @@ -1,4 +1,5 @@ import io +import sys from typing import Mapping from markdown_it import MarkdownIt @@ -11,6 +12,7 @@ yaml = ruamel.yaml.YAML() # Make sure to always have `sequence >= offset + 2` yaml.indent(mapping=2, sequence=4, offset=2) +yaml.width = sys.maxsize def update_mdit(mdit: MarkdownIt) -> None: @@ -36,4 +38,5 @@ def _render_frontmatter(node: RenderTreeNode, context: RenderContext) -> str: return node.markup + "\n" + formatted_yaml + node.markup +# apply the render function to the block identified by the mdit plugin RENDERERS: Mapping[str, Render] = {"front_matter": _render_frontmatter} diff --git a/tests/fixtures.md b/tests/fixtures.md index bafb5cd..39a6dc9 100644 --- a/tests/fixtures.md +++ b/tests/fixtures.md @@ -102,3 +102,14 @@ Dont format. Dont format. --- . + +Test long line endings +. +--- +somethingthatis: reallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylong +--- +. +--- +somethingthatis: reallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylong +--- +.