问题
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:
- WMD - Markdown, Stack Overflow uses it
- MarkItUp - Textile support but I don't know if it's WYSIWYM
- WYMEditor
Which one supports both good HTML output and Textile?
Update: I only use Markdown now, mainly because it generates slightly more semantic html and it's much more widely adopted. That, and you can use the Cloud9 Ace Editor (source on GitHub) for not only markdown but everything TextMate does.
回答1:
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);
};
回答2:
There isn't anything that fits what you're asking for out of the box.
I think WYM editor is the best starting point. I does not come with Textile support out of the box, but it can be easily extended. RDFaCE is also WYSIWYM.
MarkItUp is not WYSIWYM.
回答3:
I recently stumbled on the aptly named Jquery WYSIWYM markdown editor. With Markdown support and a solid jQuery back-end it works well for my needs.
It is available under Creative Commons and you can view the code below: http://mjs7231.bitbucket.org/jquery-wysiwym/examples/markdown.live.html
回答4:
Sanskrit seems to do WYSIWYG for Textile. See also: Rails, Textile, and javascript WYSIWYG roundup.
回答5:
If you are mostly interested in valid (X)HTML output and not strict on jQuery, you can look at Xinha - http://xinha.webfactional.com/
It's a nice editor, keeps generated code clean and is pretty stable (with lots of plugins and abilities).
来源:https://stackoverflow.com/questions/2430175/what-is-the-best-jquery-wysiwym-textile-editor