Skip to content

bug(docs find-replace --format markdown): replacement appends a trailing empty paragraph #736

Description

@sebsnyk

What happens

Replacing inline text inside an existing paragraph with docs find-replace --format markdown inserts an extra empty paragraph after the edited paragraph. Repeated markdown replacements on the same area accumulate double blank lines.

Repro

Start with a paragraph followed by a single blank line, then a next paragraph:

First paragraph ending here.

Second paragraph.
gog docs find-replace <id> "ending here." "ending here. Plus more." --format markdown

Result: the first paragraph is now followed by TWO blank paragraphs instead of one.

Expected

Replacing inline text within a paragraph should not introduce paragraph breaks — the replacement should stay within the target paragraph, leaving surrounding blank lines unchanged.

Note

The default --format plain path does not appear to add the empty paragraph; this is specific to --format markdown.

Environment

gog v0.23.0 (and current main).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions