Skip to content

Pegdown HARDWRAPS option adds an additional line break when using trailing spaces #56

Description

@Elmervc

When using the following option configuration:
new MutableDataSet( PegdownOptionsAdapter.flexmarkOptions( Extensions.ALL ) ) ,
the parser/renderer adds 2 line breaks instead of one when using 2 trailing spaces followed by a line break.

Example markdown

line one with line break
line two with line break
line three with line break and 2 trailing spaces  
line four at the end

Expected result

line one with line break
line two with line break
line three with line break and 2 trailing spaces
line four at the end

Given result

line one with line break
line two with line break
line three with line break and 2 trailing spaces

line four at the end


My current fix is to change the options to:

options = new MutableDataSet( PegdownOptionsAdapter.flexmarkOptions( Extensions.ALL & ~Extensions.HARDWRAPS ) );
options.set(HtmlRenderer.SOFT_BREAK, "<br/>");

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions