Backslashes are now correctly preserved inside code blocks while still allowing the user to escape a backtick. The handling of backticks and bold/italic wrappers was unified so that they share the same escaping code.
Backslashes only escape Markdown wrapper characters (*, _, `). If they are encountered before another character, they are considered literal.
Better half-markdown.
This fixes some issues with the current semi-markdown-parser to make life easier until a full markdown parser is implemented.
Changes:
- A * that would normally start italics but isn't matched by a closing *, is now left alone.
- A ` that would normally start a code block but isn't matched by a closing `, is now left alone.
- Backslashes should work as expected.
- Support for **bold** and the alternative _italic_ style.
Strikethrough has to be done first, before handling any other attribute,
because otherwise it doesn't render correctly.
The following changes were made:
1. When striking due to redaction, we simply strip all the other
attributes and then do the strikethrough, because this is the only
practical option.
2. When rendering rich text received from the server, we ensure we
handle strikethrough first, before any other attribute.