1

I do find a strange behaviour when i add a content to the body of a block and use the input format as full html my <b> tags are being converted to <strong> tags.I really can't get my styling correctly.I am using TinyMCE 3.5.8 module for full html.Could someone help me what might be causing this action..??

Input:

<div class='content>'
<b>Lorem Ipsum</b>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum         has been the industry's standard dummy text ever since the 1500s</p>
</div>

Output:

<div class='content>'
    <strong>Lorem Ipsum</strong>
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum         has been the industry's standard dummy text ever since the 1500s</p>
    </div>
4

1 回答 1

4

这是 TinyMCE 处理 HTML 标签的方式的问题。它会自动将多个标签替换为较新的版本(例如在您的情况下b被替换为strong)。

请注意,这本身并不是一个坏行为,因为最终结果是相同的,但它可能会令人困惑。在 HTML5 中,新strong标签优先于旧b标签。这是解释原因的页面

这是一个相关的 SO question,它回答了如何更改 TinyMCE 脚本本身的这种行为。我不确定您如何将 TinyMCE 包含在 drupal 中。如果您使用WYSIWYG 模块,则可以使用hook_wysiwyg_editor_settings_alter挂钩覆盖 TinyMCE 设置。

于 2013-06-08T15:21:42.297 回答