问题
<div rel="wikiEditor-ui-view-preview" class="current">
The class changes to 'current' when the user clicks on Preview. How can I insert some other HTML inside it, instead of displaying the preview of the text?
This preview thing only works if an user is online and I have made a parser (a JS file) which successfully parses WikiText to HTML when an user is offline. I want to link the output of the parser which is HTML and link it to this div.
回答1:
If i get your idea right, you're going to replace contents of Wikieditor "Preview" tab. These contents are generated from API call, once you clicked "Preview" Wikieditor makes AJAX request to server API ( parse method ) and display results. If you would like to override this behavior you should create extension and use one of Mediawiki hooks for API requests.
来源:https://stackoverflow.com/questions/38975188/how-to-insert-html-inside-a-div-rel