CKEdtior每次保存文档时都会添加额外的段落

时间:2017-11-24 16:29:52

标签: ckeditor typo3

我在Typo3中使用CKEditor,有一个带有配置的yaml文件。

每次保存文档时,CKEditor都会添加额外的段落并将<br />转换为<p>&nbsp;</p>

所以这个

<p>my paragraph</p>
<p>my paragraph with<br />a newline</p>

成为这个:

<p>my paragraph</p>
<p>&nbsp;</p>
<p>my paragraph with</p>
<p>a newline</p>

我尝试使用autoParagraph: false(已弃用,因此无效)和enterMode: CKEDITOR.ENTER_BR // shiftEnterMode: CKEDITOR.ENTER_BR

没有帮助......

有什么想法吗?

这就是我的yaml文件:

# Load default processing options
imports:
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" }
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" }
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml" }
# Konfiguration
editor:

  externalPlugins:
    typo3link: { resource: "EXT:rte_ckeditor/Resources/Public/JavaScript/Plugins/typo3link.js", route: "rteckeditor_wizard_browse_links" }

  config:
  # height: 70 (2 Zeilen) +20 pro weitere jede Zeile
    height: 130
    width: "auto"
    fillEmtpyBlocks: false
    ignoreEmptyParagraph: false
    enterMode: CKEDITOR.ENTER_BR
    shiftEnterMode: CKEDITOR.ENTER_BR

    # Formatauswahl
    format_tags: "h2;h3;h4;h5;h6;p"

    # Stylesheet
    contentsCss: "EXT:upd_rte_extension/Resources/Public/Css/rte.css"

    # Styleauswahl
    stylesSet:
    # Blockstile
      - { name: "Disclaimer", element: "p", attributes: { 'class': 'disclaimer' } }
      - { name: "Wichtig", element: "span", attributes: { 'class': 'important' } }

    # Buttons
      - { name: "Wow-Button", element: "a", attributes: { 'class': 'wow-button' } }

    toolbar:
    - { name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] }
    - { name: 'paragraph', items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote' ] }
    - { name: 'styles', items: [ 'Styles', 'Format' ] }
    - { name: 'about', items: [ 'About' ] }
    - '/'
    - { name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] }
    - { name: 'editing', items: [ 'Scayt' ] }
    - { name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] }
    - { name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'SpecialChar' ] }
    - { name: 'tools', items: [ 'Maximize' ] }
    - { name: 'document', items: [ 'Source' ] }

3 个答案:

答案 0 :(得分:1)

焊剂和RTE存在问题。它已经在dev分支上修复,但是如果你需要master(我们这样做)你必须应用这个修复:https://github.com/dacostafilipe/flux/commit/e1e3b5d9f48b7c45bbae1494e30f7838c24cedeb

答案 1 :(得分:0)

在之前的项目中遇到同样的问题。 在我的情况下,这是FLUX中的一个错误......我这样做了:

Flux / Classe / Form / Field / Text.php:61添加 `$ configuration ['enableRichtext'] = true; $ configuration ['richtextConfiguration'] ='完整';

答案 2 :(得分:0)

此处与8.7.13中的问题相同(当前也为9)。但是这些建议对我都不起作用!没有使用助焊剂或助焊剂。只是使用pi_flexform和类似flexform的插件:

<settings.bookingConfirmationEmailBody>
    <config>
        <type>text</type>
        <rows>5</rows>
        <cols>30</cols>
        <eval>trim,required</eval>
        <enableRichtext>1</enableRichtext>
        <richtextConfiguration>exhibitors_email</richtextConfiguration>
    </config>
</settings.bookingConfirmationEmailBody>

我发现,在“从rte到db”的方向上,正确存储了所有东西。但是“从db到rte”,换行符和<br>会转换为<p>&nbsp;</p>,每次保存时都会成倍增加。已经花了几个小时了:(