Keystone.js和tinyMCE更改<img/>和<a> tags to [img] and [a] text

时间:2016-07-13 21:46:35

标签: html tinymce keystonejs

When I make a blog post and put anchor or image tags in it via the tinyMCE buttons it shows up as:

[a]text[/a]

instead of:

<a href="...">text</a>

This happens even when I manually put in html tags. This wouldn't be a problem if everything rendered but instead when I look at the blog post I can see these converted html tags as text. I tried changing some of the tinyMCE settings:

  • valid_elements : '*[*]',
  • cleanup_on_startup: false,
  • verify_html: false,
  • cleanup: false,
  • convert_urls: false,
  • valid_children: .....

Nothing I do seems to help. Is there anyway to stop this from happening? Any help is hugely appreciated!

1 个答案:

答案 0 :(得分:1)

这个问题在其他地方得到了回答。我只需要从keystone.init中的tinyMCE插件列表中删除bbcode。我觉得很傻。所以我的所见即所得设置现在看起来像这样:

'wysiwyg cloudinary images': true,
'wysiwyg override toolbar': false,
'wysiwyg menubar': true,
'wysiwyg skin': 'lightgray',
'wysiwyg additional buttons': 'searchreplace visualchars,'
 + ' charmap ltr rtl pagebreak paste, forecolor backcolor,'
 +' emoticons media, preview print ',
'wysiwyg additional plugins': 'example, table, advlist, anchor,'
 + ' autolink, autosave, charmap, contextmenu, '
 + ' directionality, emoticons, fullpage, hr, media, pagebreak,'
 + ' paste, preview, print, searchreplace, textcolor,'
 + ' visualblocks, visualchars, wordcount, legacyoutput',
'wysiwyg images': true,

以前我在'wysiwyg附加插件'下有bbcode。