react-native-pell-rich-editor
我正在使用react-native-pell-rich-editor,同时打开链接标签,其中显示javascript关键字。请告诉我你知道为什么吗?
因为富编辑器使用 javascript 提示来显示该模式,或者您可以尝试创建自定义模式并将其添加到富编辑器添加链接功能(在 node_modules/react-native-pell-rich-editor/src/ 上找到它) editor.js)或者您可以为其制定自定义操作
editor.js 第 303 行
link: {
result: function(data) {
data = data || {};
var title = data.title;
title = title || window.getSelection().toString();
// title = title || window.prompt('Enter the link title');
var url = data.url || window.prompt('Enter the link URL');
if (url){
exec('insertHTML', "<a href='"+ url +"'>"+(title || url)+"</a>");
}
}
}
etcN00b 解决方案适用于 ios 和 android 创建自定义 URL 模态,传递编辑器的引用并在模态的自定义方法中使用 ref.insertLink(null,link)