Javascript 为什么是TinyMCE';如果内容是多个空格,则s getContent()返回epmty字符串/&;nbsp;

Javascript 为什么是TinyMCE';如果内容是多个空格,则s getContent()返回epmty字符串/&;nbsp;,javascript,tinymce,Javascript,Tinymce,如果内容是多个空格,为什么TinyMCE的getContent()返回空字符串 如果我的内容只包含空格,则getContent()方法返回空字符串 我想计算TinyMCE正文中的字符数。在TinyMCE返回编辑器内容之前,这在Editor.js中被称为: h = h.replace(/^\s*|\s*$/g, ''); // h is the content 这将删除内容开头和结尾的空格,因此,如果只插入空格,则getContent()为空。在TinyMCe返回编辑器内容之前,这在Editor

如果内容是多个空格,为什么TinyMCE的getContent()返回空字符串

如果我的内容只包含空格,则getContent()方法返回空字符串


我想计算TinyMCE正文中的字符数。

在TinyMCE返回编辑器内容之前,这在Editor.js中被称为:

h = h.replace(/^\s*|\s*$/g, ''); // h is the content

这将删除内容开头和结尾的空格,因此,如果只插入空格,则getContent()为空。

在TinyMCe返回编辑器内容之前,这在Editor.js中被调用:

h = h.replace(/^\s*|\s*$/g, ''); // h is the content
这会删除内容开头和结尾的空格,因此,当您只插入空格时,getContent()为空