First title ignored #126

Closed
opened 2026-01-29 14:28:00 +00:00 by claunia · 4 comments
Owner

Originally created by @ChaosPattern on GitHub (Jul 17, 2017).

When I tried to load the following md

# Es en castellano This note demonstrates some of what [Markdown][1] is capable of doing.

the first hashtag is ignored and it's converted as a paragraph

<p># Es en castellano</p>\n<p>This note demonstrates some of what <a href=\"http://daringfireball.net/projects/markdown/\">Markdown</a> is capable of doing.</p>

instead of

<h1> # Es en castellano</h1>\n<p>This note demonstrates some of what <a href=\"http://daringfireball.net/projects/markdown/\">Markdown</a> is capable of doing.</a>

I'm using this piece of code

Markdown.ToHtml(Text);

thanks in advance

Originally created by @ChaosPattern on GitHub (Jul 17, 2017). When I tried to load the following md `# Es en castellano This note demonstrates some of what [Markdown][1] is capable of doing.` the first hashtag is ignored and it's converted as a paragraph `<p># Es en castellano</p>\n<p>This note demonstrates some of what <a href=\"http://daringfireball.net/projects/markdown/\">Markdown</a> is capable of doing.</p>` instead of `<h1> # Es en castellano</h1>\n<p>This note demonstrates some of what <a href=\"http://daringfireball.net/projects/markdown/\">Markdown</a> is capable of doing.</a>` I'm using this piece of code `Markdown.ToHtml(Text);` thanks in advance
Author
Owner

@evan-rash commented on GitHub (Oct 6, 2017):

@ChaosPattern was this resolved? I am running into the same issue with leading # being converted to paragraphs

@evan-rash commented on GitHub (Oct 6, 2017): @ChaosPattern was this resolved? I am running into the same issue with leading `#` being converted to paragraphs
Author
Owner

@xoofx commented on GitHub (Oct 7, 2017):

Could you reproduce it on https://babelmark.github.io ?

@xoofx commented on GitHub (Oct 7, 2017): Could you reproduce it on https://babelmark.github.io ?
Author
Owner

@ChaosPattern commented on GitHub (Oct 7, 2017):

yes, was my mistake, in order to make some test I downloaded a md file from internet and the format was wrong (it has some bits were were wrong) I created new one in the notepad, and it's worked

@ChaosPattern commented on GitHub (Oct 7, 2017): yes, was my mistake, in order to make some test I downloaded a md file from internet and the format was wrong (it has some bits were were wrong) I created new one in the notepad, and it's worked
Author
Owner

@RyanfaeScotland commented on GitHub (Nov 3, 2023):

Just stumbled across the same issue, discovered it was an encoding problem.

Visual Studio 2022 defaults to creating new text files in UTF8-BOM encoding, and this was leading to the mentioned issue of the first header being skipped. Switching the file's encoding to UTF8 resolved the issue.

Leaving this comment as a help for others with the same issue.

@RyanfaeScotland commented on GitHub (Nov 3, 2023): Just stumbled across the same issue, discovered it was an encoding problem. Visual Studio 2022 defaults to creating new text files in UTF8-BOM encoding, and this was leading to the mentioned issue of the first header being skipped. Switching the file's encoding to UTF8 resolved the issue. Leaving this comment as a help for others with the same issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#126