Bug #88303

lang-attribute for CKEditor not saved

Added by dermueller no-lastname-given about 1 year ago. Updated 8 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2019-05-08
Due date:
% Done:

0%

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

Description

The file EXT:rte_ckeditor/Configuration/RTE/Processing.yaml already includes this configuration:

processing:
  ## allowed default attributes
  allowAttributes: [class, id, title, dir, lang, xml:lang, itemscope, itemtype, itemprop]

This includes the "lang"-attribute. But when I add this attribute to any tag in the RTE's source code view manually, it get's removed when saving. So my idea was to add this condiguration:

processing:
  HTMLparser_db:
    tags:
      h2:
        allowedAttribs:
          - lang
      p:
        allowedAttribs:
          - lang

But the "lang"-attribute still gets deleted when saving.

History

#1 Updated by Benni Mack about 1 year ago

  • Status changed from New to Needs Feedback

Hey,

where to you add your lang attribute?

Can you provide your full RTE config + the example HTML that you tried out?

Thanks!

#2 Updated by Riccardo De Contardi 11 months ago

Maybe the solution is to install the "language" CKEditor plugin (already shipped with TYPO3);

I tried the following test with a fresh TYPO3 9.5.x

1) Install the language plugin - the relevant part of the YAML file is:

editor:
   config:
      # add the toolbargroup paragraph if needed, it must incude 'bidi' (example taken from Full.yaml configuration file)
      toolbarGroups:
         - { name: paragraph, groups: [ list, indent, blocks, align, bidi ] }

      extraPlugins:
         - bidi
         - language

      # Example of languages configuration:
      language_list: [ 'he:Hebrew:rtl', 'pt:Portuguese', 'de:German' ]

2) No further configuration ( allowAttributes, etc)

3)Create a text content element

4) the "language" button is present; you can mark a phrase and use the dropdown to select the language

5) the generated HTML is (for example)

<span lang="he" dir="rtl">Lorem ipsum dolor sit amet</span>

#3 Updated by Riccardo De Contardi 8 months ago

  • Status changed from Needs Feedback to Closed

No feedback since the last 90 days => closing this issue.

If you think that this is the wrong decision or experience the issue again and have more information about how to reproduce your problem, please reopen it or open a new issue with a reference to this one.

Thank you and best regards

#4 Updated by dermueller no-lastname-given 8 months ago

@Riccardo De Contardi:

I can confirm that the configuration you provide above (#2) works even in TYPO3 8.7.27. So the solution is to install the "language" CKEditor plugin. Which I also had problems with - see Bug #88302. I think this ticket can be marked as solved.

Also available in: Atom PDF