HTML markup gets added after certain tags
When translating basic pages, the LLM inserts \<p\> tags after other tags like \</strong\> Example input: ``` <p>'De Geheimen van het Hof' is een reeks van zes speurtochten voor klassen: <strong>van het 1ste leerjaar tot en met het 6de leerjaar.</strong> De focus ligt op een kennismaking met West-Vlaanderen én op het prachtig neogotisch erfgoedpand.</p> <p><strong>Meer informatie een de inschrijvingslink vind je hieronder</strong></p> ``` Becomes: ``` <p>'The Secrets of the Court' is a series of six scavenger hunts for classes: <strong>from 1st grade</strong></p> <p>up to and including 6th grade. The focus is on getting to know West Flanders as well as the magnificent Neo-Gothic heritage building.</p> <p><strong>More information and the registration link can</strong></p> <p>be found below</p> ``` The issue can't be solved by including this directly in the instructions for the LLM under `/admin/config/ai/ai-translate` , which was tested with additions like: ``` 1. Translate the natural text line-by-line. 2. CRITICAL STRUCTURAL RULE: Keep all HTML tags on their exact original lines. Never insert a closing </p> tag on a line where it did not originally exist. If a sentence spans across text, do not break the line or inject HTML tags in the middle of that sentence. ``` Versions used: * Paragraphs 8.x-1.20 * Drupal Core 11.3.10 :warning: The issue doesn't reproduce when using the drush command, it only triggers through GUI ⚠️ The issue doesn't reproduce on more recent setups that use Layout Builder. (rather than the above which are Drupal 11 upgrades of older sites) --- The fix: application of this patch: [ai__preserve_html_in_streamed_output.patch](/uploads/2c54df2b2e31b347b202b16c0531cf46/ai__preserve_html_in_streamed_output.patch)
issue