The multiple meanings of #
by Dave Winer Tuesday, October 18, 2016

It's really interesting how many "format collisions" there are with the # character.

  • First, it is used to delimit #hashtags.
  • In Markdown, when it appears at the beginning of a line, it's treated as a headline.
  • In XML it's used in the representation of a character with its numeric code. For example F is a capital F.

This came up when I added Markdown support in screen2.io. When a hashtag appeared at the beginning of the first line, the Markdown processor would remove the # and embolden and enlarge the line text. Not the intention of the author.

How I worked around it. If a # appears as the first character in a post, I replace it with the XML encoding, # -- and so the Markdown processor doesn't see it as anything special and leaves it alone.

When the text flows to Twitter, if that connection is enabled, the # is left alone.