JQuery based WMD version (perfect SO version)

Here are the facts when they stand:

  • I have a Django admin page, although this question has nothing to do with Django.
  • There are several <textarea> on this page.
  • I want to leave $('textarea.wmd').wmd() and see the WMD edit panels appear at the top of my <textarea> s.

I had manual work with the original version of WMD and poked with Dana SO version ... But they are both global (bind to the same ID). I also saw mooWMD , which is a port of the MooTools version of Dana SO, but I have ridden the MooTools train before and I don’t want to drag this to my admin pages.

So simple, is there a jQuery port for Dana code (or another) that can join multiple targets?

+8
jquery wmd-editor
source share
1 answer

I found this jQuery plugin for WMD after a quick search: https://github.com/openlibrary/wmd

This is a fork of the Dana SO version, and one of the main changes in Readme claims that it can work with multiple text fields on one page , and this is the jQuery plugin.

Include the script in your page, and then name it in your text areas as follows:

 $(function() { $('textarea.wmd').wmd(); }); 

As far as I know, this answers your question.

+12
source share

Source: https://habr.com/ru/post/650202/


All Articles