What is the Best JQuery WYSIWYM Textile Editor?

前端 未结 5 702
刺人心
刺人心 2021-01-30 01:38

I need to use a Textile (preferably instead of Markdown), and am looking for a nice WYSIWYM (not WYSIWYG, because of this) JQuery editor.

I\'ve seen these:

5条回答
  •  失恋的感觉
    2021-01-30 02:31

    Use Textile.js which is a fully featured Textile parser in JavaScript!

    Use can try out the Textile live web editor here http://borgar.github.com/textile-js/

    I am using it in combination with Markitup

    Here is my simple code:

    $(document).ready(function () {
        init();
    });
    
    function init() {
        var $content = $('.markitup'); // my textarea
        var $preview = $('#textile-preview'); // the preview div
    
        $content.markItUp(mySettings); // init markitup
    
        // use a simple timer to check if the textarea content has changed
        var value = $content.val();
        setInterval(function () {
            var newValue = $content.val();
            if (value != newValue) {
                value = newValue;
                $preview.html(textile.convert(newValue)); // convert the textile to html
            }
        }, 500);
    };
    

提交回复
热议问题