CommonMark/Markdown Java parser with source level AST. CommonMark 0.28, emulation of: pegdown, kramdown, markdown.pl, MultiMarkdown. With HTML to MD, MD to PDF, MD to DOCX conversion modules.
BSD 2-Clause "Simplified" License
2.21k
stars
260
forks
source link
Level-1 heading not parsed if preceded by UTF-8 BOM #601
If a Markdown file is saved with the UTF-8 encoding with a BOM (Byte Order Mark) at the beginning, and the first element in the file is a level-1 heading, then the rendered HTML has the literal text as a <p> instead of an <h1>.
I realize that this is a client-side issue, not an issue with flexmark. flexmark is justified in assuming that the input string has been decoded correctly. Apologies for the noise.
Description
If a Markdown file is saved with the UTF-8 encoding with a BOM (Byte Order Mark) at the beginning, and the first element in the file is a level-1 heading, then the rendered HTML has the literal text as a
<p>
instead of an<h1>
.Parser
HtmlRenderer
Formatter
FlexmarkHtmlParser
DocxRenderer
PdfConverterExtension
Steps to reproduce
Sample Markdown input (save as UTF-8 with BOM):
Expected behavior
Output HTML contains:
Observed behavior
Output HTML contains:
System information
flexmark-all
v0.64.6