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