Skip to content

Conversation

@jlevy
Copy link
Owner

@jlevy jlevy commented Jan 15, 2026

Summary

  • When Flowmark wraps long Markdoc tags across multiple lines, the closing tag could end up on the same line as the opening tag's closing delimiter (%}), triggering a Markdoc parser bug
  • This fix ensures that when an opening tag spans multiple lines, the closing tag is placed on its own line

Before (triggers Markdoc bug):

{% field kind="string" id="name" label="Name" required=true
maxLength=50 %}{% /field %}

After (correct):

{% field kind="string" id="name" label="Name" required=true
maxLength=50 %}
{% /field %}

Changes

  • Added _fix_multiline_opening_tag_with_closing() function in tag_handling.py
  • Integrated fix into all wrapper return paths in add_tag_newline_handling()
  • Added 4 unit tests in test_tag_formatting.py
  • Added Issue 7 test cases in testdoc

Test plan

Fixes #17

🤖 Generated with Claude Code

When Flowmark wraps long Markdoc tags across multiple lines, the closing
tag could end up on the same line as the opening tag's closing delimiter,
triggering a Markdoc parser bug.

This fix ensures that when an opening tag spans multiple lines, the
closing tag is placed on its own line.

Fixes #17

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jlevy jlevy merged commit c8efd7f into main Jan 15, 2026
5 checks passed
@jlevy jlevy deleted the feature/fix-multiline-tag-closing branch January 15, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Line wrapping inside Markdoc tags breaks parser when closing tag is on same line

2 participants