This commit is contained in:
Tyler Brown Cifu Shuster 2020-08-11 10:01:41 -07:00
parent 7abeebc672
commit d86b240c7a

View File

@ -94,8 +94,10 @@ export class ChatInput extends Component {
let message = [];
let isInCodeBlock = false;
let endOfCodeBlock = false;
text.split(/\r?\n/).forEach((line) => {
message.push('\n');
text.split(/\r?\n/).forEach((line, index) => {
if (index !== 0) {
message.push('\n');
}
// A line of backticks enters and exits a codeblock
if (line.startsWith('```')) {
// But we need to check if we've ended a codeblock