返回介绍

tinymce-html-Entities

发布于 2019-05-06 06:50:01 字数 4642 浏览 966 评论 0 收藏 0

Methods

namesummarydefined by
decode()Decodes the specified string, this will replace entities with raw UTF characters.tinymce.html.Entities
encodeAllRaw()Encoded the specified text with both the attributes and text entities. This function will produce larger text contents since it doesn't know if the context is within a attribute or text node. This was added for compatibility and is exposed as the DOMUtils.encode function.tinymce.html.Entities
encodeNamed()Encodes the specified string using named entities. The core entities will be encoded as named ones but all non lower ascii characters will be encoded into named entities.tinymce.html.Entities
encodeNumeric()Encodes the specified string using numeric entities. The core entities will be encoded as named ones but all non lower ascii characters will be encoded into numeric entities.tinymce.html.Entities
encodeRaw()Encodes the specified string using raw entities. This means only the required XML base entities will be encoded.tinymce.html.Entities
getEncodeFunc()Returns an encode function based on the name(s) and it's optional entities.tinymce.html.Entities

Methods

decode

decode(text:String):String

Decodes the specified string, this will replace entities with raw UTF characters.

Parameters
  • text (String) - Text to entity decode.
Return value
  • String - Entity decoded string.

encodeAllRaw

encodeAllRaw(text:String):String

Encoded the specified text with both the attributes and text entities. This function will produce larger text contents since it doesn't know if the context is within a attribute or text node. This was added for compatibility and is exposed as the DOMUtils.encode function.

Parameters
  • text (String) - Text to encode.
Return value
  • String - Entity encoded text.

encodeNamed

encodeNamed(text:String, attr:Boolean, entities:Object):String

Encodes the specified string using named entities. The core entities will be encoded as named ones but all non lower ascii characters will be encoded into named entities.

Parameters
  • text (String) - Text to encode.
  • attr (Boolean) - Optional flag to specify if the text is attribute contents.
  • entities (Object) - Optional parameter with entities to use.
Return value
  • String - Entity encoded text.

encodeNumeric

encodeNumeric(text:String, attr:Boolean):String

Encodes the specified string using numeric entities. The core entities will be encoded as named ones but all non lower ascii characters will be encoded into numeric entities.

Parameters
  • text (String) - Text to encode.
  • attr (Boolean) - Optional flag to specify if the text is attribute contents.
Return value
  • String - Entity encoded text.

encodeRaw

encodeRaw(text:String, attr:Boolean):String

Encodes the specified string using raw entities. This means only the required XML base entities will be encoded.

Parameters
  • text (String) - Text to encode.
  • attr (Boolean) - Optional flag to specify if the text is attribute contents.
Return value
  • String - Entity encoded text.

getEncodeFunc

getEncodeFunc(name:String, entities:String):function

Returns an encode function based on the name(s) and it's optional entities.

Parameters
  • name (String) - Comma separated list of encoders for example named,numeric.
  • entities (String) - Optional parameter with entities to use instead of the built in set.
Return value
  • function - Encode function to be used.

Can't find what you're looking for? Let us know.

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文