fix(fusion_repairs): wrap Wysiwyg content with markup() so HTML renders, not escapes
User reported the rich text editor showing raw HTML tags as literal text
instead of rendering them as formatted prose. Root cause: Odoo's Editor
delegates content insertion to setElementContent() (web/core/utils/html.js),
which only takes the innerHTML branch when the content was flagged as safe
markup via owl's markup() helper. Plain strings fall through to the
textContent branch, which is what the user was seeing:
<p>Ask the client if the stairlift has power. Check:</p> <ul> <li>...
instead of the rendered paragraph + list.
The canonical html_field.js in @html_editor wraps its value with markup()
before passing it to the Wysiwyg config; I missed that detail.
FIX
- import markup from @odoo/owl
- in wysiwygConfig getter, wrap the saved content_html string with
markup() before assigning to config.content
- pass markup("") for empty content (avoids editor confusion with falsy)
- load-bearing comment to keep future refactors from re-introducing the bug
VERIFIED
- upgrade clean
- 7 stale asset bundles flushed, container restarted, login serves 200
- new bundle 014fee9 renders 10029808 bytes
- node --check PARSE_OK
- compiled bundle contains: content:rawHtml?markup(rawHtml):markup("")
which is exactly the markup-wrapped path the Editor wants
Bumped to 19.0.2.2.4.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
{
|
||||
'name': 'Fusion Repairs',
|
||||
'version': '19.0.2.2.3',
|
||||
'version': '19.0.2.2.4',
|
||||
'category': 'Inventory/Repairs',
|
||||
'summary': 'Guided medical equipment repair intake, dispatch, maintenance, and self-service portal',
|
||||
'description': """
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* the source of truth for the designer view and the node/edge tables are
|
||||
* the source of truth for the runtime traversal.
|
||||
*/
|
||||
import { Component, onMounted, onWillUnmount, useRef, useState } from "@odoo/owl";
|
||||
import { Component, markup, onMounted, onWillUnmount, useRef, useState } from "@odoo/owl";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { rpc } from "@web/core/network/rpc";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
@@ -106,8 +106,13 @@ export class FlowchartDesigner extends Component {
|
||||
*/
|
||||
get wysiwygConfig() {
|
||||
const meta = this.selectedMeta;
|
||||
// CRITICAL: wrap the HTML string with markup() so the editor's
|
||||
// setElementContent() takes the innerHTML branch instead of the
|
||||
// textContent branch - otherwise the editor renders our tags as
|
||||
// literal text instead of formatted prose / lists.
|
||||
const rawHtml = meta?.content_html || "";
|
||||
return {
|
||||
content: meta?.content_html || "",
|
||||
content: rawHtml ? markup(rawHtml) : markup(""),
|
||||
Plugins: MAIN_PLUGINS,
|
||||
// onChange fires after each edit step - read the current HTML
|
||||
// from the editor and persist it to selectedMeta + dirty flag.
|
||||
|
||||
Reference in New Issue
Block a user