精简版 CKEditor 与 Markdown

发布于 2024-10-01 09:07:39 字数 276 浏览 0 评论 0原文

我一直在研究为什么所见即所得编辑器不利于内容创建。最常见的原因是它们输出了不正确的 html。但是如果我使用功能减少的编辑器怎么办?

我的要求只是能够将文本设置为斜体、将文本设为粗体、创建有序/无序列表以及(也许稍后)添加内联图像。
我的用户希望是“持久”用户(少数外行经常使用该应用程序)

在这种情况下,我如何在 Markdown(WMD 编辑器)和 Markdown(WMD 编辑器)之间进行选择?一个精简的所见即所得编辑器。每个页面的性能会受到怎样的影响?我认为保真度和数据的可重复性很重要。

I have been looking into why WYSIWYG editors are bad for content creation. The most common reason given is that they output incorrect html. But what if I use editors with reduced functionality?

My requirements are only the ability to italicize, make text bold, create ordered/unordered lists and (maybe at a later date) add inline images.
My users will hopefully be 'persistent' users (small numbers of laypersons using the app frequently)

In this context how do I choose between Markdown (WMD editor) & a stripped down WYSIWYG editor. How would page performance be affected with each? I consider fidelity & reproduciblity of data to be important.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

独自唱情﹋歌 2024-10-08 09:07:39

您可以根据您的受众进行选择。 Wiki 标记和 Markdown 是为极客准备的。您的客户听起来好像他们可能不是极客,所以我建议非极客用户使用 CKEditor 或 Twiki 风格的编辑器(良好、简单的 Wysiwyg UI)。

基本问题:当存在可靠的替代方案时,为什么还要强迫外行人学习标记语言?

请参阅此 CKEditor 演示中的自定义工具栏编辑器。或者查看 TinyMCE

You choose by considering your audience. Wiki markup and markdown is for geeks. Your customers sound like they're probably not geeks so I would suggest CKEditor or Twiki-style editor (good, simple Wysiwyg UI) for non-geek users.

Basic concern: Why force lay-people to learn a markup language when solid alternatives exist?

See the Custom Toolbar editor in this CKEditor demo. Or check out TinyMCE.

深者入戏 2024-10-08 09:07:39

好的,我测试了两者。
即使对于我的基本格式要求,CKEditor 也生成了相当可怕的 html

现在这是输入

This actually appears to be better  
I hope users understand what we are doing  
Lets see

But in the meantime

CKEditor 输出

<p> This actually appears to be better</p>
<p> I hope users understand what we are doing</p>
<p> Lets see</p>
<p>  </p>
<p> But in the meantime</p>

和 Markdown 输出

<p>This actually appears to be better <br>
I hope users understand what we are doing <br>
Lets see</p>

<p>But in the meantime</p>

现在如果这是最基本的格式(换行符和段落)两者之间的区别,那么在 200 中会是什么样子词提交。我认为大多数用户只需要知道这一点

For line breaks, two SPACES and hit ENTER.
For new paragraphs, hit ENTER twice

其余的东西可以逐步学习
设计一个“基本”所见即所得编辑器有那么难吗?

编辑

将这些添加到 config.js 后,上述问题就解决了

config.enterMode = CKEDITOR.ENTER_BR;
config.shiftEnterMode = CKEDITOR.ENTER_P;

OK, I tested both.
Even for my basic formatting requirements, CKEditor generated quite ghastly html

Now this is the input

This actually appears to be better  
I hope users understand what we are doing  
Lets see

But in the meantime

CKEditor Output

<p> This actually appears to be better</p>
<p> I hope users understand what we are doing</p>
<p> Lets see</p>
<p>  </p>
<p> But in the meantime</p>

And Markdown Output

<p>This actually appears to be better <br>
I hope users understand what we are doing <br>
Lets see</p>

<p>But in the meantime</p>

Now if this is the difference between these two for the most basic formatting (linebreaks and paragraphs), what will it be like in a 200 word submission. I think most users will need to know only this

For line breaks, two SPACES and hit ENTER.
For new paragraphs, hit ENTER twice

The rest of the stuff could be learnt incrementally
Is it that hard to engineer a 'basic' WYSIWYG editor?

EDIT

After adding these to config.js above problem is solved

config.enterMode = CKEDITOR.ENTER_BR;
config.shiftEnterMode = CKEDITOR.ENTER_P;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文