(text)
| 300 | |
| 301 | // 插入回复文本到编辑器 |
| 302 | function insertReplyText(text) { |
| 303 | const editor = findEditor(); |
| 304 | if (!editor) { |
| 305 | console.error('未找到编辑器'); |
| 306 | return false; |
| 307 | } |
| 308 | |
| 309 | const currentText = editor.getValue(); |
| 310 | let newText; |
| 311 | |
| 312 | if (currentText.trim() === '') { |
| 313 | newText = text; |
| 314 | } else { |
| 315 | // 如果已有内容,在末尾添加 |
| 316 | newText = currentText + '\n\n' + text; |
| 317 | } |
| 318 | |
| 319 | editor.setValue(newText); |
| 320 | editor.focus(); |
| 321 | |
| 322 | return true; |
| 323 | } |
| 324 | |
| 325 | // 重置为默认回复 |
| 326 | function resetToDefault() { |
no test coverage detected