We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0fb8651 commit 8184ce2Copy full SHA for 8184ce2
server/api/articles.js
@@ -360,8 +360,6 @@ router.patch('/api/admin/article/edit', confirmToken, async (req, res) => {
360
const updates = {}
361
try {
362
if (Reflect.get(req.body, 'content')) {
363
- // 删除富文本中的标签等,保留静态文本字段
364
- updates.content_plain = req.body.content.replace(/<.*?>|\n| /g, '')
365
// 默认存储为草稿
366
updates.content_draft = req.body.content
367
// 重要!一定要删除!
@@ -370,6 +368,8 @@ router.patch('/api/admin/article/edit', confirmToken, async (req, res) => {
370
368
// 文档 发布/更新 content 与 content_draft保持一致同步
371
369
if (req.body.editing === '0') {
372
updates.content = updates.content_draft
+ // 删除富文本中的标签等,保留静态文本字段
+ updates.content_plain = updates.content.replace(/<.*?>|\n| /g, '')
373
}
374
375
// 数据存储前获取原始发布状态
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments