Issue Bug Closed

#77145using font-weight in contentCss breaks bold-button

Dominik Hahn 07/18/16, 14:55 updated 05/18/17, 14:43

Description

Hey guys,

a customer was complaining that it is not possible to revert the formatting of a word/sentence once it has been set to be “bold“
Normally you would click “b” to make it bold and click “b” again to revert the formatting.

I dug deeper and it seems to be a problem when using `contentCss` and `font-weight` in the custom CSS file.

RTE.default.useCss = 0
RTE.default.contentCSS = EXT:my_ext/Resources/Public/Css/rte.css

My CSS (stripped down and simplified) looks like this:

b,
strong {
  font-weight: normal;
}

As soon as I change it to:

b,
strong {
  color: fuchsia;
}

the formatting works again (changing the color to fuchsia on first click and back to black on second click).

Setting the font-weight breaks it, the value does not matter.

Without my CSS, the HTML of the editor looks like this:

<body class="htmlarea-content-body" contenteditable="true"><p>Dieser Text ist voll fett.</p>
</body>

Clicking the “b” once changes it to:

<body class="htmlarea-content-body" contenteditable="true"><p><b>Dieser Text ist voll fett.</b></p>
</body>

Clicking the “b” again changes it to:

<body class="htmlarea-content-body" contenteditable="true"><p>Dieser Text ist voll fett.</p>
</body>

With font-weight applied, the source remains like this:

<body class="htmlarea-content-body" contenteditable="true"><p><b>Dieser Text ist voll fett.</b></p>
</body>

no matter how often I click, the “b”-tag remains.

I have verified this on
  • TYPO3 7.6.9
  • TYPO3 8.3.0-dev (master b2b622e)
both on:
  • Google Chrome (Mac, latest)
  • Safari (Mac, latest)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.