svivian / q2a-markdown-editor

Markdown editor plugin for Question2Answer
55 stars 24 forks source link

added an admin option to configure the editor for third party templates #15

Closed amiyasahu closed 7 years ago

amiyasahu commented 9 years ago

First of all thank you for this great plugin .

In the current version of MDEditor plugin only renders on the ask and question pages . But it does not work with the other plugins which are trying to use markdown editor on a specific page .

Basically it is controlled by the code in the layer

$tmpl = array( 'ask', 'question' );
if (!in_array($this->template, $tmpl))
            return;

In the pull request I made the feature bit more flexible , where an field is added called "allowed templates" and by default set to "questions,ask" and user can add the templates they want there so that the MD Editor can be rendered on those plugin pages too .

svivian commented 7 years ago

Sorry I'd completely forgotten about this. Do you have an example of a plugin that utilises the Markdown editor? I'm thinking that outputting based on templates (both my current system and your proposal) is not the best way. There should be a way to detect whether or not the current page requires the editor.