From a3c8502cd7019f5a2135ddd73b6ac78bac1205dc Mon Sep 17 00:00:00 2001 From: Gary Guo Date: Sun, 5 Apr 2020 03:50:40 +0000 Subject: [PATCH] Fix issue #39 --- assets/common.js | 3 ++- includes/API.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/common.js b/assets/common.js index 66d4ac0..5845b22 100644 --- a/assets/common.js +++ b/assets/common.js @@ -247,7 +247,8 @@ function ReplyBox(thread) { title: (thread && thread.post.title) || mw.config.get('wgTitle'), prop: 'text', preview: true, - text: val + text: val, + pst: true, }).done(function(result) { previewPanel.html(result.parse.text['*']); }).fail(function(error, obj) { diff --git a/includes/API.php b/includes/API.php index 78a7d1f..8660d31 100644 --- a/includes/API.php +++ b/includes/API.php @@ -354,7 +354,8 @@ public function execute() { // Set options for parsing $opt = new \ParserOptions($this->getUser()); - $output = $parser->parse($text, \Title::newFromId($page), $opt); + $text = $parser->preSaveTransform($text, $title, $this->getUser(), $opt); + $output = $parser->parse($text, $title, $opt); $text = $output->getText(['enableSectionEditLinks' => false]); // Edit button will not work! // Get all mentioned user