fix code-block for markdown mode

This commit is contained in:
Aviral Dasgupta 2017-02-22 02:51:57 +05:30
parent 32dd89774e
commit 3a07fc1601
No known key found for this signature in database
GPG key ID: 5FD1E9F4FFD3DA80

View file

@ -485,7 +485,7 @@ export default class MessageComposerInput extends React.Component {
'italic': (text) => `*${text}*`, 'italic': (text) => `*${text}*`,
'underline': (text) => `_${text}_`, // there's actually no valid underline in Markdown, but *shrug* 'underline': (text) => `_${text}_`, // there's actually no valid underline in Markdown, but *shrug*
'strike': (text) => `~~${text}~~`, 'strike': (text) => `~~${text}~~`,
'code': (text) => `\`${text}\``, 'code-block': (text) => `\`\`\`\n${text}\n\`\`\``,
'blockquote': (text) => text.split('\n').map((line) => `> ${line}\n`).join(''), 'blockquote': (text) => text.split('\n').map((line) => `> ${line}\n`).join(''),
'unordered-list-item': (text) => text.split('\n').map((line) => `- ${line}\n`).join(''), 'unordered-list-item': (text) => text.split('\n').map((line) => `- ${line}\n`).join(''),
'ordered-list-item': (text) => text.split('\n').map((line, i) => `${i + 1}. ${line}\n`).join(''), 'ordered-list-item': (text) => text.split('\n').map((line, i) => `${i + 1}. ${line}\n`).join(''),