mkdocs: Pages encoded UTF-8 with BOM not rendered correctly

Hello,

I have a simple index markdown file:

# Project

## Overview

And it fails to render correctly in any theme.

Cinder keqxxqn - imgur

ReadTheDocs amsuaqe - imgur

Am I doing something wrong? If I change it to a level 2 heading, the same thing happens.

I can workaround it by placing a blank line at the start of the file, but then the heading appears too low:

6xtusui - imgur

Thanks.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (14 by maintainers)

Commits related to this issue

Most upvoted comments

Well, I used Powershell’s Out-File -Encoding utf8 to modify links in the markdown before calling mkdocs. As it seems Powershell’s default setting for utf8 is with BOM 😉

Oh course that’s what Windows is doing 🤦‍♂️. That’s such a Windows thing to do.

Well, that’s good news. At least the issue has been clearly identified. As far as I know, MkDocs doesn’t allow you to specify encoding, so as long as you use proper UTF-8, you should be fine. Maybe this should be more clearly stated in the documentation if it isn’t already.