—- " added in HTML when converting MarkDown file to HTML using Jekyll tool

2.6k views Asked by At

I have used Jekyll tool to convert MarkDown file To HTML. It has been successfully converted to HTML. but the below following encoded punctuation characters has been added at the top of the HTML, due to the file encoded format is Encode in UTF-8.

  "—-"

After changed the same markdown file to Encode in ANSI format in NotePad++[encoding option in menu bar]. The punctuation character not included in generated HTML.

In this we need to manually change the markdown file to ANSI for HTML generation 'Jekyll'.

Any solution for this?

3

There are 3 answers

0
Anandh On

This encoding format issue. make the markdown file in UTF-8 without BOM format. This will remove the punctuation character in 'html' .

0
Tharaka Arachchige On

try using charset=utf-8
or
Check your content has any straight double quote (" ") or straight single quote (' ') and remove those

http://practicaltypography.com/straight-and-curly-quotes.html

4
tripleee On

 is the UTF-8 BOM so that's probably what you are seeing, assuming you are looking at it using CP1252; and — is something out of the General Punctuation block.

Proper diagnostics are not possible without an indication of which character encoding you are using instead of UTF-8 to view the file, and/or what exact bytes you have in the file, probably as a hex dump. The first few bytes (the BOM) would be EF BB BF. See also the character-encoding tag wiki for troubleshooting tips.

Quick googling indicates that Jekyll is highly allergic to UTF-8 BOM in its input, so it seems unlikely that it generates spurious BOM characters on output. I could speculate that the template file you are using has a BOM and that it is being faithfully included in the output, but I'm not really familiar enough with Jekyll to actually help troubleshoot any further.

Of course, as per the big ugly warnings all over the Jekyll site, I assume you have already made sure that your Markdown input doesn't have a BOM character. Many Windows editors are notorious for putting one in when you save as UTF-8; make sure you use "UTF-8 without a BOM" as the "Save As..." format -- and switch to an editor which offers this option if yours doesn't have it.