odoo/odoo#264152

Created by fw-bot
Merged at 6e7dc94e84fcdd9d3d0c57a1e755471cd1d972fa

Statuses:

label
odoo-dev:saas-19.3-saas-18.4-opw-5950228-toc_html_style-sben-525872-fw
head
23dcb1f54209a1c23d82c525b54eef5afdca5761
merged
3 days ago by Saif Allah Ben Khalil (sben)
odoo/odoo
saas-18.4 #260378
19.0 #263161
saas-19.1 #263547
saas-19.2 #264086
saas-19.3 #264152
master #265483

[FIX] website: update table of content navbar when heading style changes

Steps to reproduce:

  1. Enable a second language on the website
  2. Add a Table of Content snippet to a page
  3. Apply bold (or any inline style) to one of the headings, save
  4. Switch to the second language in translation mode
  5. Translate the styled heading and save

=> The TOC navbar entry keeps showing the source text on reload.
=> Expected: navbar shows the translated heading text, unstyled.

Cause:

When a TOC heading carries inline markup, the server emits the
heading and the navbar entry as two independent translation terms
with different data-oe-translation-source-sha values, even though
their textContent matches. A translation written under the heading's
sha therefore never reaches the navbar's slot.

handleToC was meant to bridge that by aliasing the navbar span's
sha to the heading's during translation-mode setup, but two issues
prevented it from working in saas-18.4+:

Solution:

opw-5950228

Forward-Port-Of: #263547
Forward-Port-Of: #260378