Skip to content

Markdown file with CRLF line endings will cause wrong-style output #423

@jinliming2

Description

@jinliming2

Hi, When I started to use blackfriday to parse my Markdown file, I got a wrong-style output.
My Markdown file looks like this, with Windows-style CRLF (\r\n) line endings:

# Hello World

This is my content.

And I wrote the code like this in my project:

func main() {
	file, err := ioutil.ReadFile("./test.md")
	if err != nil {
		println(err)
	}
	println(string(file))
	println("---------------------------------------------")
	out := blackfriday.Run(file)
	println(string(out))
}

And now, when I ran my program, I got output in my console like this:

# Hello World

This is my content.

---------------------------------------------
</h1>ello World

<p>
</p> is my content.

Is this a problem in blackfriday?
Thanks.

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