Skip to content

writeAdfText drops newlines between paragraphs and headings #11

Description

@calin-marian

Problem

The writeAdfText ADF renderer in formatter.zig uses an iterative DFS with a stack. When a block-level node (paragraph, heading, list, etc.) has a content array, the code pushes children onto the stack and continues. This skips the block-level newline check that follows, so newlines between paragraphs are never emitted.

In practice, multi-paragraph Jira descriptions render as a single run of text:

First paragraphSecond paragraph

instead of:

First paragraph
Second paragraph

Fix

Added an is_block boolean to each stack frame. When pushing children for a block-level node, is_block is set to true. When a frame is exhausted (all children processed), the newline is emitted if is_block is true. This ensures block boundaries appear after the content, not before.

References

Fixed in PR #7 (commit 1e12dd1). Also affects PRs #8 and #9 which inherit the fix via rebase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions