Review main Merged

87462[BUGFIX] Avoid empty paragraphs when localizing rich text

Benni Mack CR +2 V +2 Normal +55 −32 updated 03/10/25, 12:03

Commit message

The default test set is extended to also check for
CType and bodytext in tt_content in order to fix
the issue that when a record with a text field
with "richtext" is included, the "Translate to French"
prefix is added inside the first paragraph, otherwise,
instead of before, adding the prefix into its own
paragraph and also adding another empty paragraph
after the first one.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 2

Files 8

Review log 1723

  1. Benni Mack uploaded patch set 1 12/11/24, 20:08

  2. core-ci voted on patch set 1 V -1 12/11/24, 20:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70984

  3. Benni Mack uploaded patch set 2 V -1 12/11/24, 22:58

  4. core-ci voted on patch set 2 V -1 12/11/24, 23:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70987

  5. Garvin Hicking commented on patch set 1 12/11/24, 23:10

    DataMapProcessor.php:1335

    I kind of love the pragmatism about this, because the problem is really hard to fix "properly". This opens up some edge case scenarios (using square brackets instead of angular ones to not annoy gerrit): ``` [video]some video strings[/video] [figure]...[/figure] [ul][li]...[/li][/ul] [table][tr]...[/tr][/table] No HTML tag but an equation with 5 [ 3 and 3 ] 5 ``` All these would be viable HTML block level elements and could maybe get - swallowed by CKE (best case) or - break the HTML (worst case) or - lead to oddly formatted "please translate" messages (shrug case). What do you think about just prefixing [p]translate...[/p] in case an opening angle bracket is found? Pros: - would not mangle non-html contents - would have its own styling - needs no regexp replace Cons: - "p" tags might get scrubbed later - might insert HTML where none is expected - newline handling could be an issue then? Just a thought, not blocking, feel free to disregard as being too edge-casey ramblings of a sleepless man.
  6. Benni Mack commented on patch set 2 12/11/24, 23:11

    DataMapProcessor.php:1335 Reply

    I'm fine with just checking for p tags. This issue is annoying and can't be solved "cleanly" in the current architecture, this I know for sure. But I still consider it "better than before" and helpful for 80% of the users out there.
  7. Benni Mack commented on patch set 2 CR -1 12/11/24, 23:15

    OK. I do think that with our current testbase / new test options, we should finally check that bodytext with "CType=text" runs through RteHtmlparser - which our tests currently don't do.
  8. Benni Mack updated the commit message in patch set 3 CR -1 V -1 12/12/24, 00:12

  9. core-ci voted on patch set 3 V -1 12/12/24, 00:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70989

  10. Benni Mack uploaded patch set 4 V -1 12/19/24, 20:42

  11. Benni Mack rebased onto patch set 5 12/19/24, 20:42

  12. core-ci voted on patch set 5 V +1 12/19/24, 20:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71475

  13. core-ci voted on patch set 4 V -1 12/19/24, 20:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71474

  14. Garvin Hicking commented on patch set 5 CR +1 V +1 12/20/24, 08:16

    DataMapProcessor.php:1335 Reply

    Acknowledged
  15. Riccardo De Contardi commented on patch set 5 V +1 12/23/24, 14:34

    Verified on latest master with a "Regular text element" CE, 2 languages and the sample text provided in the issue description
  16. Benni Mack uploaded patch set 6 CR +1 V +1 03/08/25, 14:49

  17. core-ci voted on patch set 6 V +1 03/08/25, 14:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75352

  18. Simon Schaufelberger voted on patch set 6 CR +1 V +1 03/08/25, 21:38

  19. Stefan Bürk commented on patch set 6 CR -1 03/10/25, 11:20

    -1 Reviewing ...
  20. Stefan Bürk voted on patch set 6 CR +1 V +1 03/10/25, 11:45

  21. Stefan Bürk commented on patch set 6 03/10/25, 11:51

    Reply

    Done
  22. Benni Mack voted on patch set 6 CR +2 V +2 03/10/25, 12:03

  23. Benni Mack merged patch set 7 03/10/25, 12:03