集成Markdown WYSIWYG文本编辑器 [英] Integrated Markdown WYSIWYG text editor

查看:956
本文介绍了集成Markdown WYSIWYG文本编辑器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在寻找Markdown代码的一个简单的WYSIWYG编辑器,我找不到一个与CkEditor,TinyMCE等可比较的UI。



具体来说,通常推荐的MarkdownWYSIWYG编辑器(例如做到这一点。附加项目是








2015年4月13日更新

一些自称开发CKEditor的人说, CommonMark 的外观是一个游戏规则,我们可能看到一个正确的 CKEditor的标记界面(阅读完整故事的评论)。






2015年2月6日更新



CKEditor现在提供一个输出(并接受为输入)BBCode的插件。



演示: http://ckeditor.com/demo #bbcode

解决方案

我当时正在研究这个主题,我还没有找到任何正确的所见即所得编辑器带Markdown输出。事实上,首先你必须创建一个WYSIWG Markdown编辑器是WYSIWG HTML编辑器,并且只有很少的它们在市场上可用。



有机会您将能够为CKEditor创建 dataProcessor ,它会将HTML编辑器更改为Markdown编辑器。我们为BBCode提供了一个插件(如下所示)(请查看 http://nightly-v4.ckeditor .com / 3737 / samples / bbcode.html )。



所有你需要做的是实现这个接口http://nightly-v4.ckeditor.com/ckeditor_api/#!/api/CKEDITOR.data处理程序。如果你检查BBCode插件的代码,你会看到一些黑客和技巧,因为不幸的是,当前的CKEditor的架构还没有准备好创建这样的数据处理器。但是,我相信,如果你只想提供几个样式选项,你应该能够很快实现Markdown支持。


In looking for a straightforward WYSIWYG editor for Markdown code, I am not finding a comparible UI to that of CkEditor, TinyMCE, ect.

Specifically, the Markdown "WYSIWYG" editors that are often recommended (such as posts like this ) are not pure WYSIWYG editors in the sense that users either still write raw Markdown ( MarkItUp ) or go to the other extreme of having in-line editing without standard controls ( Hallo ).

I need something in-between.

I'm looking for a Markdown editor that looks and functions like a stripped down CkEditor text box, and that accepts and outputs Markdown. There should be a toolbar with a minimum set of formatting options (B, I, U, lists, ect), and the text entry area should show the converted Markdown, not the raw code. There should be a Source button that will allow users to edit the raw Markdown, but even that is optional. Ex:

I get the reason for Markdown/wiki, ect - the security it offers. I don't mind entering raw code like here at SE, but my users are not geeks and do not find this enjoyable. They don't want to see * * * ___ and spaces mixed in with their text. They are used to "Word" style editing, and are most productive in that environment.

So - is there a truly integrated WYSIWYG editor for Markdown? I'm writing in a PHP, so something that I can invoke with a class would be perfect.


Sept 23, 2015 Update

CKEditor now has a Markdown addon that does this exact thing. The addon project is hosted on github.

Screenshots:


Apr 13, 2015 Update
Someone professing to develop CKEditor says that the appearance of CommonMark is a game changer, and we could possibly see a proper markup interface for CKEditor (read comments for the full story).


Feb 6, 2015 Update

CKEditor now comes with a plugin that outputs (and accepts as input) BBCode.

Demo: http://ckeditor.com/demo#bbcode

解决方案

I was researching in this subject the other day and I haven't found any decent WYSIWYG editor with Markdown output. In fact, first you have to have to create a WYSIWG Markdown editor is WYSIWG HTML editor and there are just few of them that are usable on the market.

There's a chance that you'll be able to create dataProcessor for CKEditor that will change HTML editor into Markdown editor. We've got a plugin for BBCode that works like this (check out http://nightly-v4.ckeditor.com/3737/samples/bbcode.html).

All you have to do is implement this interface http://nightly-v4.ckeditor.com/ckeditor_api/#!/api/CKEDITOR.dataProcessor. If you check BBCode plugin's code you'll see some hacks and tricks, because unfortunately current CKEditor's architecture isn't ready (yet) to create such a data processor. However, I believe that if you want to provide only few styling options you should be able to implement Markdown support pretty quickly.

这篇关于集成Markdown WYSIWYG文本编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆