gpt4 book ai didi

asp.net - AddThis 标记未显示在 TinyMCE html 编辑器中

转载 作者:行者123 更新时间:2023-11-27 22:47:22 25 4
gpt4 key购买 nike

我设计了一个内容管理系统,它使用 XML 文件作为基础。除了 AddThis 的标记没有出现在 tinymce 编辑器中之外,一切都已完成并且运行良好。它甚至不会出现在 HTML View 中。这没什么大不了的,除非用户编辑页面的该部分,它会删除 addthis 控件。

有什么想法吗?

这是标记在页面和 xml 文件中的方式:

<div style="float: left; margin-top: 1px; font-family: arial; color: #005396; margin-left: 3px; font-size: medium; margin-right: 200px;">Join Our Mailing List</div>
<div style="clear: right; float: right;">
<div style="text-align: center; margin-top: 8px; font-family: arial; clear: left; float: left; color: #333333; font-size: large; vertical-align: middle;">Check Out _ Weekly <br /><span style="font-family: arial; color: #005396; font-size: large;">National Polling Summary </span></div>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" style="float: right; padding-top: 15px;">
<a class="addthis_button_facebook"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_email"></a>
<a class="addthis_button_compact"></a>
</div>
</div>

在tinymce的HTML部分

<div style="float: left; margin-top: 1px; font-family: arial; color: #005396; margin-    left: 3px; font-size: medium; margin-right: 200px;">Join Our Mailing List</div>
<div style="clear: right; float: right;">
<div style="text-align: center; margin-top: 8px; font-family: arial; clear: left; float: left; color: #333333; font-size: large; vertical-align: middle;">Check Out _ Weekly <br /><span style="font-family: arial; color: #005396; font-size: large;">National Polling Summary </span></div>
</div>

这是我的 tinymce 初始化:

tinyMCE.init({
// General options
mode: "textareas",
theme: "advanced",
plugins: "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",

// Theme options
theme_advanced_buttons1: "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4: "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "bottom",
theme_advanced_resizing: true,
relative_urls: false,
editor_deselector : "mceNoEditor",


// Example content CSS (should be your site CSS)
// using false to ensure that the default browser settings are used for best Accessibility
// ACCESSIBILITY SETTINGS
content_css: "Symba/Styles/CSS/Site.css",
// Use browser preferred colors for dialogs.
browser_preferred_colors: true,
detect_highcontrast: true,

// Drop lists for link/image/media/template dialogs
template_external_list_url: "lists/template_list.js",
external_link_list_url: "lists/link_list.js",
external_image_list_url: "lists/image_list.js",
media_external_list_url: "lists/media_list.js",

// Style formats
style_formats: [
{ title: 'Bold text', inline: 'b' },
{ title: 'Red text', inline: 'span', styles: { color: '#ff0000'} },
{ title: 'Red header', block: 'h1', styles: { color: '#ff0000'} },
{ title: 'Example 1', inline: 'span', classes: 'example1' },
{ title: 'Example 2', inline: 'span', classes: 'example2' },
{ title: 'Table styles' },
{ title: 'Table row 1', selector: 'tr', classes: 'tablerow1' }
],

// Replace values for the template plugin
template_replace_values: {
username: "Some User",
staffid: "991234"
}
});

更新

好的,我尝试将其添加到 init 函数中

 valid_elements: "*[*]",
extended_valid_elements: "*[*]"

这使 div 恢复正常,但我仍然没有获得 anchor 标记。

最佳答案

FCKEditor 和 Tinyeditor 默认移除空元素。尝试像这样向 anchor 添加空格:

<a class="addthis_button_facebook">&nbsp;</a>           
<a class="addthis_button_twitter">&nbsp;</a>
<a class="addthis_button_email">&nbsp;</a>
<a class="addthis_button_compact">&nbsp;</a>


<div style="float: left; margin-top: 1px; font-family: arial; color: #005396; margin-left: 3px; font-size: medium; margin-right: 200px;">Join Our Mailing List</div>
<div style="clear: right; float: right;">
<div style="text-align: center; margin-top: 8px; font-family: arial; clear: left; float: left; color: #333333; font-size: large; vertical-align: middle;">Check Out _ Weekly <br />
<span style="font-family: arial; color: #005396; font-size: large;">National Polling Summary </span></div>
<div style="float: right; padding-top: 15px;" class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_facebook">&nbsp;</a>
<a class="addthis_button_twitter">&nbsp;</a>
<a class="addthis_button_email">&nbsp;</a>
<a class="addthis_button_compact">&nbsp;</a>
</div>
</div>

关于asp.net - AddThis 标记未显示在 TinyMCE html 编辑器中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6406812/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com