diff --git a/src/Markdown.js b/src/Markdown.js index 4a46ce4f24..134520b775 100644 --- a/src/Markdown.js +++ b/src/Markdown.js @@ -62,6 +62,9 @@ function is_multi_line(node) { */ export default class Markdown { constructor(input) { + // Support GH-style strikeout + input = input.replace(/~~(.*?)~~/g, '$1'); + this.input = input; const parser = new commonmark.Parser(); diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index 4d7c0f7a80..5ea92d18ce 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -397,7 +397,7 @@ export default class MessageComposerInput extends React.Component { 'bold': (text) => `**${text}**`, 'italic': (text) => `*${text}*`, 'underline': (text) => `_${text}_`, // there's actually no valid underline in Markdown, but *shrug* - 'strike': (text) => `~~${text}~~`, + 'strike': (text) => `${text}`, 'code-block': (text) => `\`\`\`\n${text}\n\`\`\``, 'blockquote': (text) => text.split('\n').map((line) => `> ${line}\n`).join(''), 'unordered-list-item': (text) => text.split('\n').map((line) => `\n- ${line}`).join(''),