Mirror of Steamdown (Markdown -> Steam Markup converter)
0

Configure Feed

Select the types of activity you want to include in your feed.

Use double underscores for underlines

This changes underscore syntax to require two underscores (`__`) to
wrap text instead of just one underscore (`_`).

One of the benefits of this is that underscores in words, like a URL or
some type of slug-like string, will not be treated as special syntax,
being removed and converted to underlines. Underscores are pretty common
in Steam URLs, so this can be especially annoying.

If Steam allows double underscores in its URLs, and its fairly common,
this might need to be revisited.

This also addresses #247.

Closes #247

Spenser Black (Mar 31, 2025, 7:46 PM EDT) ce734a6e 6e67016b

+9 -9
+3 -3
packages/html/__tests__/demo.stmd
··· 20 20 * *italics* 21 21 * **bold** 22 22 * ***bold and italics*** 23 - * _underlines_ 23 + * __underlines__ 24 24 * >!spoilers!< 25 25 * ~~strike outs~~ 26 - * *_you can mix and match BTW_* 26 + * *__you can mix and match BTW__* 27 27 * {noparse spans are literal. *this won't be rendered* and Steam will show literal [i]} 28 28 29 29 {{{ ··· 65 65 | | | 66 66 | no | border | 67 67 68 - [ref]: https://example.com/ref/ 68 + [ref]: https://example.com/ref/
+1 -1
packages/site/src/demo.stmd
··· 11 11 12 12 * *italics* 13 13 * **bold** 14 - * _underline_ 14 + * __underline__ 15 15 * >!spoiler!< 16 16 * ~~strikes~~ 17 17 * {noparse}
+2 -2
packages/steamdown/__tests__/assets/demo.test.txt
··· 20 20 * *italics* 21 21 * **bold** 22 22 * ***bold and italics*** 23 - * _underlines_ 23 + * __underlines__ 24 24 * >!spoilers!< 25 25 * ~~strike outs~~ 26 - * *_you can mix and match BTW_* 26 + * *__you can mix and match BTW__* 27 27 * {noparse spans are literal. *this won't be rendered* and Steam will show literal [i]} 28 28 29 29 {{{
+1 -1
packages/steamdown/__tests__/assets/underlined in italicized.test.txt
··· 1 - *Italicized and _underlined_* 1 + *Italicized and __underlined__*
+1 -1
packages/steamdown/__tests__/assets/underlined.test.txt
··· 1 - _Underlined text_ 1 + __Underlined text__
+1 -1
packages/steamdown/src/parser/inline/underline.ts
··· 6 6 * Parser for an underline node. 7 7 */ 8 8 export const underline = makeWrappedTextParser<nodes.Underline>( 9 - "_", 9 + "__", 10 10 "underline", 11 11 ) satisfies Parser<nodes.Underline>;