Skip to content

Soft line break is dropped before emphasis #12

Description

@waterson

Description

A soft line break is dropped when the following line starts with emphasized text. This joins words that should be separated by a space in the rendered ADF.

Reproduction

markdownToAdf("**Type:** chore\n**Estimated scope:** S (1-2 files)")

The resulting paragraph contains " chore" followed immediately by the strong-marked "Estimated scope:", so Jira renders choreEstimated scope:.

Plain soft breaks are converted to spaces correctly (a\nb becomes a b), while explicit Markdown hard breaks still produce hardBreak nodes.

Cause

getSafeText removes a newline at the end of an inline text token before replacing remaining newlines with spaces. Marked places the soft break in a trailing text token when the next token is emphasis, so that newline is removed rather than normalized.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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