Search code examples
githubformattingmarkdown

How to add empty spaces into MD markdown readme on GitHub?


I'm struggling to add empty spaces before the string starts to make my GitHub README.md looks something like this:

enter image description here

Right now it looks like this:

enter image description here

I tried adding <br /> tag to fix the new string start, now it works, but I don't understand how to add spaces before the string starts without changing everything to &nbsp;. Maybe there's a more elegant way to format it?


Solution

  • Instead of using HTML entities like &nbsp; and &emsp; (as others have suggested), you can use the Unicode em space (8195 in UTF-8) directly. Try copy-pasting the following into your README.md. The spaces at the start of the lines are em spaces.

    The action of every agent <br />
      into the world <br />
    starts <br />
      from their physical selves. <br />