我如何自定义hallo.js以使用< strong>而不是< b&gt ;? [英] How do i customize hallo.js to use <strong> instead of <b>?

查看:114
本文介绍了我如何自定义hallo.js以使用< strong>而不是< b&gt ;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题几乎说明了一切。我正在使用 hallo.js ,它似乎在使用< b> < i> 表示粗体和斜体。我的某些标记当前需要 strong em 才能适用某些CSS规则。我也更喜欢 strong em 而不是 b i ,所以我想配置它。

The question pretty much says it all. Im using hallo.js and it seems to use <b> and <i> for bold and italic. Some of my markup currently requires strong and em in order to have certain CSS rules apply. I also prefer strong and em in general to b and i so Id like to configure this.

似乎没有关于此的任何文档,可以吗?

There doesnt seem to be any documentation on this directly - can it be done?

推荐答案

由于标记不取决于hallo.js或任何其他富文本编辑器,因此无法完成。它们只是触发插入标记,但是插入是由浏览器完成的。您将在不同的浏览器中得到略有不同的结果。只能通过最后更改标记来解决。

This can't be done as the markup is not up to hallo.js or any other rich text editor. They just trigger inserting markup, but the inserting is done by the browser. You will get slightly different results from different browsers. A workaround is possible only by changing the markup at the end.

针对评论问题的文档进行编辑:
问题是这是自IE发明设计标准以来的浏览器行为。 whatwg是在HTML5标准中编写的。要获取有关该主题本身的更多信息,请阅读

http://www.quirksmode .org / dom / execCommand.html

http://dev.opera.com/articles/view/rich-html-editing-in-the-browser-part-1/

http://www.thismuchiknow.co.uk/?p=64

http: //www.whatwg.org/specs/web-apps/2007-10-26/multipage/section-contenteditable.html

http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html

http://www.w3.org/wiki/Web_Editing_APIs

http://annevankesteren.nl/2005/07/contenteditable

http://www.sitepoint.com/the-tragic-comedy-这是在Web上丰富的文本编辑/

Edit for point to docs on comment question: The problem is that this is behavior of browsers since IE invented design mode without being a standard. The whatwg wrote it in the standard for HTML5. To get more information on the topic itself read
http://www.quirksmode.org/dom/execCommand.html
http://dev.opera.com/articles/view/rich-html-editing-in-the-browser-part-1/
http://www.thismuchiknow.co.uk/?p=64
http://www.whatwg.org/specs/web-apps/2007-10-26/multipage/section-contenteditable.html
http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html
http://www.w3.org/wiki/Web_Editing_APIs
http://annevankesteren.nl/2005/07/contenteditable
http://www.sitepoint.com/the-tragic-comedy-that-is-rich-text-editing-on-the-web/

这篇关于我如何自定义hallo.js以使用&lt; strong&gt;而不是&lt; b&gt ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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