Bug #65695
closedRTE.default.proc.transformBoldAndItalicTags = 1 doesn't remap
0%
Description
Text is written in RTE. Some text marked as bold. Save.
RTE-Source show: <strong>sdjhfsdh</strong>
Database stored: <b>sdjhfsdh</b>
Frontend show: <b>sdjhfsdh</b>
Browser is Safari. TYPO3 6.2.10.
Updated by Riccardo De Contardi over 8 years ago
My test with the latest versions - clean installations, just:
PageTSConfig:
RTE.default.showButtons = * RTE.default.proc.transformBoldAndItalicTags = 1
6.2.15
before save: <p>Test <b>bold</b> and <i>italic</i> tag</p> after save: <p>Test <strong>bold</strong> and <em>italic</em> tag</p> database: Test <b>bold</b> and <i>italic</i> tag frontend: <p class="bodytext">Test <b>bold</b> and <i>italic</i> tag</p>
7.1.6-dev (latest master)
before save: <p>test <b>bold</b> and <i>italic</i> tag</p> after save: <p>test <strong>bold</strong> and <em>italic</em> tag</p> database: test <b>bold</b> and <i>italic</i> tag frontend: <p>test <b>bold</b> and <i>italic</i> tag</p>
Official documentation about RTE.default.proc.transformBoldAndItalicTags
https://docs.typo3.org/typo3cms/CoreApiReference/Rte/Transformations/Tsconfig/Index.html
Default is to convert b and i tags to strong and em tags respectively in the direction of the database, and to convert back strong and em tags to b and i tags in the direction of the RTE.
This transformation may be disabled by setting this property to 0.
I don't understand if this can be considered a standard behavior, then :S
Updated by Heinz Schilling over 8 years ago
Does the documentation not say the following?
<b> in RTE is transformed to <strong> in database and back to <b> in the RTE?
If not I can't find any sense in this configuration.
Updated by Riccardo De Contardi over 8 years ago
Well, in database, they are still saved as <b> and <i>, so everything is a bit confusing...I mean, "in the direction of the database" means that they are saved as <strong> and <em> in database or not?
It is also not clear (for me) what is the purpose of this settings...
what is the purpose of having <b> -> save:<strong> -> database: <b> -> frontend:<b>?
Moreover, if I am not wrong, if you want to transform <b> -> <strong> you have also:
RTE.default.proc.tags.b.remap = strong
Updated by Heinz Schilling over 8 years ago
I found this old discussion about the feature: https://forum.typo3.org/index.php/t/159567/ see last entry
I want to reach this behavior:
before save: <p>Test <b>bold</b> and <i>italic</i> tag</p> because RTE can only insert <b> and <i> after save: <p>Test <strong>bold</strong> and <em>italic</em> tag</p> database: Test <strong>bold</strong> and <em>italic</em> tag frontend: <p class="bodytext">Test <strong>bold</strong> and <em>italic</em> tag</p>
Purpose of this setting I think is to switch from style tags like <b> and <i> to structural tags like <strong> and <em>. A little step for more search engine optimization.
I mean before TYPO3 6.2.10
RTE.default.proc.transformBoldAndItalicTags = 1wrote <strong> and <em> to database and rendered this in frontend. After I had to remap and
RTE.default.proc.transformBoldAndItalicTags = 1was unusable (for me).
Maybe Stanislas Rolland does know more about the purpose of this setting?
Updated by Riccardo De Contardi over 7 years ago
I still don't understand the purpose of this setting... I would have expected something like:
b,i > become strong, em
strong,em > become b,i
I tried the following test with 8.4-dev:
1) Test 1 disable proc.transformBoldAndItalicTags¶
TSCONFIG:¶
RTE.default.proc.transformBoldAndItalicTags = 0
RTE:¶
<p><b>BOLD</b> AND <i>ITALIC</i></p> <p><strong>STRONG</strong> AND <em>EMPHASYS</em></p>
Results:¶
after save:
<p><b>BOLD</b> AND <i>ITALIC</i></p> <p><b>STRONG</b> AND <i>EMPHASYS</i></p>
on database:
<p><b>BOLD</b> AND <i>ITALIC</i></p> <p><strong>STRONG</strong> AND <em>EMPHASYS</em></p>
output:
<p><b>BOLD</b> AND <i>ITALIC</i></p> <p><strong>STRONG</strong> AND <em>EMPHASYS</em></p>
1) Test 2 enable proc.transformBoldAndItalicTags¶
TSCONFIG:¶
RTE.default.proc.transformBoldAndItalicTags = 1
RTE¶
<p><b>BOLD</b> AND <i>ITALIC</i></p> <p><strong>STRONG</strong> AND <em>EMPHASYS</em></p>
after save
<p><strong>BOLD</strong> AND <em>ITALIC</em></p> <p><strong>STRONG</strong> AND <em>EMPHASYS</em></p>
database
<p><b>BOLD</b> AND <i>ITALIC</i></p> <p><b>STRONG</b> AND <i>EMPHASYS</i></p>
output
<p><b>BOLD</b> AND <i>ITALIC</i></p> <p><b>STRONG</b> AND <i>EMPHASYS</i></p>
If you want to perform the transformation b>strong; i>em the good way should be:
RTE.default.proc.transformBoldAndItalicTags = 0 RTE.default.proc.entryHTMLparser_db.tags.b.remap = strong RTE.default.proc.entryHTMLparser_db.tags.i.remap = em
Updated by Luc Muller over 7 years ago
I'm also experienccing strange behavior with : RTE.default.proc.transformBoldAndItalicTags = 1
With TYPO3 7.6.12
<p><b>strong</b></p>
is remapped to
<p><strong>strong</strong></p>
Which seems correct to me.
but
<ul> <li><b>strong</b></li> </ul>
is not remmaped the same way.
Any one can confirm this is right now the state of art of TYPO3 Behaviour ?
Updated by Heinz Schilling over 7 years ago
TYPO3 7.6.14
rtehtmlarea 7.6.0: Configuration: Typical
In typical configuration both are active:
RTE.default.proc.transformBoldAndItalicTags = 1
RTE.default.FE.proc.transformBoldAndItalicTags = 1
With TYPO3 7.6.14 this is done by TYPO3:
Input in RTE before save:
<p><b>BOLD</b> AND <i>ITALIC</i></p> <p><strong>STRONG</strong> AND <em>EMPHASYS</em></p>
Input in RTE after save:
<p><strong>BOLD</strong> AND <em>ITALIC</em></p> <p><strong>STRONG</strong> AND <em>EMPHASYS</em></p>
In database:
<b>BOLD</b> AND <i>ITALIC</i> <b>STRONG</b> AND <i>EMPHASYS</i>
In frontend:
<p><b>BOLD</b> AND <i>ITALIC</i></p> <p><b>STRONG</b> AND <i>EMPHASYS</i></p>
And I think, these is wrong.
From Documentation
Default is to convert b and i tags to strong and em tags respectively in the direction of the database
I understand this as we have <b> in RTE and <strong> in database and in frontend
and to convert back strong and em tags to b and i tags in the direction of the RTE.
... we have <strong> in database and <b> in RTE
Reason: In frontend it's better to have <strong>. <strong> is logical an <b> is physical/optical. And I think this is the reason for this configuration option transformBoldAndItalicTags.
RTE seems to understand only <b>. And we have to convert them in the direction to database and back to RTE.
Before TYPO3 6.2.10 this configuration does <b> in RTE, and convert to <strong> in database and frontend.
Did you agree?
Updated by Benni Mack over 7 years ago
Hey,
this is the correct behaviour, so no bug:
1) If option is explicitly turned on or not set at all, then everything that is written in the RTE (em, strong, b, i) is ALWAYS mapped to b/i in the DB
2) If b/i is in the DB the RTE is always showing STRONG/EM instead
3) Frontend does what it's in the DB
If you want to have strong and em be stored in the DB, just disable the setting explictly.
Updated by Riccardo De Contardi over 7 years ago
- Status changed from New to Closed
Note: This option is removed from TYPO3 version 8.6 (see https://review.typo3.org/#/c/51289/5); a remap of the tags could be done with:
RTE.default.proc { # make <strong> and <em> tags when sending to the RTE HTMLparser_rte { tags { b.remap = strong i.remap = em } } # make <b> and <i> tags when sending to the DB HTMLparser_db { tags { strong.remap = B em.remap = I } } }