Bug #85038

allowTagsOutside not working in rte_ckeditor

Added by Loon Buster over 2 years ago. Updated 9 months ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2018-05-17
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

hello

processing:
   allowTagsOutside: [div, a, img, hr, span, table]

NOT working!

.loon


Related issues

Related to TYPO3 Core - Bug #92301: Elements getting wrapped with p tags, even if allowed outside paragraph Under Review 2020-09-13

History

#1 Updated by Patrick Gaumond over 2 years ago

  • Category set to Linkvalidator

#2 Updated by Wouter Wolters over 2 years ago

  • Subject changed from ext:rte_ckeditor to allowTagsOutside not working in rte_ckeditor
  • Category changed from Linkvalidator to RTE (rtehtmlarea + ckeditor)
  • Priority changed from Must have to Could have
  • Target version deleted (8.7.13)

#3 Updated by Benni Mack about 2 years ago

  • Status changed from New to Needs Feedback

What do you expect to set this option?

#4 Updated by Riccardo De Contardi about 2 years ago

I can guess (correct me if I am wrong) that the goal is avoiding that some tags becomes surrounded by <p>

e.g.

<p> lorem </p>
<span>ipsum</span> 
<p>dolor sit amet</p>

should not become

<p> lorem </p>
<p><span>ipsum</span></p> 
<p>dolor sit amet</p>

I add here some considerations after tests made with TYPO3 9.4 and the following CKEditor configuration (an enriched clone of minimal.yaml configuration):

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

# Minimal configuration for the editor
editor:
  config:
    toolbarGroups:
      - { name: basicstyles, groups: [ basicstyles] }
      - { name: clipboard, groups: [clipboard, undo] }
      - { name: insert}
      - { name: mode}      
    removeButtons:
      - Anchor
      - Superscript
      - Subscript
      - Underline
      - Strike

The tests always imply to write the code directly in the "source code" mode and then switching back to the standard mode.

1) even without the code written in the description, table and hr are placed in the editor area without a surrounding <p>

1.1) Please note that "table" is not mentioned in the processing.allowTagsOutside shipped by default with TYPO3 (Processing.yaml file)

2) using the source button to add a <div> in the text, it is converted to a <p> just switching to the standard editor view

2.1) using

  config:
    extraAllowedContent:
      - div

things go better: now the <div> is kept, but with a <p> inside after saving the content element

from

<div>lorem ipsum</div>

to

<div>
  <p>lorem ipsum</p>
</div>

3) about img, a, span I guess that they become wrapped with <p> because CKEditor considers them inline elements, thus they are not allowed to live outside <p>

#5 Updated by Loon Buster about 2 years ago

Benni Mack wrote:

What do you expect to set this option?

counterquestion: why is this option removed?

..i mean: how can somebody change a module without knowing/set-up the functions of the old module? its like to build a new car without brake and to ask "what do you expect to set this option?"

.loon

#6 Updated by Susanne Moog almost 2 years ago

  • Sprint Focus set to On Location Sprint

#7 Updated by Benni Mack almost 2 years ago

Hi Loon!

Loon Buster wrote:

Benni Mack wrote:

What do you expect to set this option?

counterquestion: why is this option removed?

This option is not removed... don't know where you got this information, so I do not really understand your counterquestion.

I would also love to get an answer to my question.

..i mean: how can somebody change a module without knowing/set-up the functions of the old module? its like to build a new car without brake and to ask "what do you expect to set this option?"

Sorry, but this comes up to be a bit rude. I actually spent several months working on parsing RTE better and simpler, and I haven't found anyone in TYPO3 community to actually understand all variations of all options (yes, I had to look at the initial SVN commit from 2003 and call up Kasper). It feels like you do know lot about RTE processing, so I'm very eager to learn from your knowledge, maybe you can support me/us to document this behaviour better, and especially provide examples when to use this option in v8 and v9 and when to extend it.

Thanks a lot in advance, feel free to contact me for further work together, give me a call, write me on slack or email, or answer here directly!

Benni.

#8 Updated by taywa gmbh almost 2 years ago

  • Priority changed from Could have to Should have
  • TYPO3 Version changed from 8 to 9

I am missing this option too. I would like to use this get to get rid of the sourounding p tags, as Ricardo writes above.

I would like to use it for a RTE content with mixed hand written html code.

See here: https://www.aarenet.com/de/meta/kontakt/ "Hauptnummer" now has p tag with a class. But I would like to use span. Then no css is needed.

And its in the documentation https://docs.typo3.org/typo3cms/TSconfigReference/PageTsconfig/Rte.html. Not explicitly for ckeditor, but thats what people think. (As I did)

If you decide not to fix it, please remove it from the docs.

#9 Updated by Susanne Moog 9 months ago

  • Sprint Focus deleted (On Location Sprint)

#10 Updated by Tobias Ulber 9 days ago

  • Related to Bug #92301: Elements getting wrapped with p tags, even if allowed outside paragraph added

Also available in: Atom PDF