Merge branch 'main' into fix/fix-joined-check-color

This commit is contained in:
SleeplessOne1917 2023-07-02 19:25:36 +00:00 committed by GitHub
commit b3d096d41d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -702,18 +702,20 @@ export class MarkdownTextArea extends Component<
quoteInsert() {
const textarea: any = document.getElementById(this.id);
const selectedText = window.getSelection()?.toString();
const { content } = this.state;
let { content } = this.state;
if (selectedText) {
const quotedText =
selectedText
.split("\n")
.map(t => `> ${t}`)
.join("\n") + "\n\n";
if (!content) {
this.setState({ content: "" });
content = "";
} else {
this.setState({ content: `${content}\n` });
content = `${content}\n\n`;
}
this.setState({
content: `${content}${quotedText}`,
});