TinyMCE生成随机< g>标签? [英] TinyMCE generating random <g> tags?

查看:148
本文介绍了TinyMCE生成随机< g>标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在TinyMCE所见即所得编辑器中保存了一些页面内容后,我发现以下HTML标签贯穿整个内容:

 < g class =gr_ gr_283 gr-alert gr_spell gr_run_anim gr_inline_cards ContextualSpelling ins-del multiReplaceid =283data-gr-id =283>< / g> 

它通常会围绕单词或句子。它不会改变内容的外观,因为这些类在任何样式表中都没有被引用,但是它干扰了偶尔的通配符,这些通配符会被内容自动替换。



我在网上找不到任何答案,但是使用类名搜索已经返回了一些结果,其中类似的标签生成为页面内容的纯文本。



有人知道为什么发生这种情况,并且如果有办法阻止它? ://github.com/tinymce/tinymce/issues/3625#issuecomment-299881345rel =nofollow noreferrer>将这个错误提交给Tinymce的开发者,他们回应说这个错误是由于Goolge Chrome扩展程序 Grammarly 。安装这个扩展后,我能够复制错误,并可以用语法确认问题。语法上是在内容的周围注入了不正确拼写/语法的元素。



我使用javascript替换函数实现了我自己的修复。 >

  function getWysiwygValue(id){
var value = tinyMCE.get(id).getContent();
value = value.replace(/< \ /?g [^>]> / g,);
返回值;
}

我也联系了Grammarly来通知他们这个错误,希望他们会回应并在他们的最后解决问题。


After saving some page content in the TinyMCE WYSIWYG editor, I've found that the following HTML tag is peppered throughout the content:

<g class="gr_ gr_283 gr-alert gr_spell gr_run_anim gr_inline_cards ContextualSpelling ins-del multiReplace" id="283" data-gr-id="283"></g>

It will often wrap itself around words or sentences. It doesn't change the appearance of the content as the classes are not referenced in any stylesheets, however it has interfered with the occasional wildcards that are meant to be auto-replaced with content.

I couldn't find any answers online, however googling the class names has returned a number of results where similar tags are generated into the plain text of a page's content.

Anybody know why this occurs and if there is a way to prevent it?

解决方案

I submitted this as a bug to the developers of Tinymce, they responded saying that the bug is caused with the Goolge Chrome extension Grammarly. After installing this extension I was able to replicate the bug and can confirm the problem is with Grammarly. Grammarly is injecting the elements around content that has incorrect spelling/grammar.

I have implemented my own fix for this using a javascript replace function to remove the elements.

function getWysiwygValue(id) {
    var value = tinyMCE.get(id).getContent();
    value = value.replace(/<\/?g[^>]*>/g, "");
    return value;
}

I have also contacted Grammarly to notify them of this bug, hopefully they will respond and fix the problem on their end.

这篇关于TinyMCE生成随机&lt; g&gt;标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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