logoalt Hacker News

nine_kyesterday at 4:38 PM2 repliesview on HN

Indeed. I'd go with dead simple rules. The below assumes whitespace or punctuation on either side:

  *bold*
  _italic_
  *_bold italic_*
  _*also bold italic*_
Any other combination does not parse as formatting, and is considered literal text. Yes, this prevents marginally useful cases like putting an italic fragment in the middle of the word. I'd be fine with that.

Replies

NetMageSCWtoday at 6:13 PM

So y = x * 7 + b * c will be bolded in the middle?

xigoiyesterday at 4:46 PM

If I’m understanding correctly, your rules are based on word boundaries? How do you define a word boundary?

show 1 reply