details:   https://code.tryton.org/tryton/commit/cd3931840db9
branch:    default
user:      Cédric Krier <[email protected]>
date:      Thu Nov 20 17:03:46 2025 +0100
description:
        Escape completion content with custom format

        Closes #14363
diffstat:

 sao/CHANGELOG     |  1 +
 sao/src/common.js |  8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 4e3e875a295e -r cd3931840db9 sao/CHANGELOG
--- a/sao/CHANGELOG     Mon Nov 17 12:26:57 2025 +0100
+++ b/sao/CHANGELOG     Thu Nov 20 17:03:46 2025 +0100
@@ -1,3 +1,4 @@
+* Escape completion content with custom format (issue14363)
 * Use sandboxed iframe to display document (issue14290)
 * Add support for multiple button in the tree view
 * Support shortcuts on modal
diff -r 4e3e875a295e -r cd3931840db9 sao/src/common.js
--- a/sao/src/common.js Mon Nov 17 12:26:57 2025 +0100
+++ b/sao/src/common.js Thu Nov 20 17:03:46 2025 +0100
@@ -3835,9 +3835,13 @@
         },
         _format: function(content) {
             if (this.format) {
-                return this.format(content);
+                content = this.format(content);
             }
-            return jQuery('<span/>').text(content);
+            if (content instanceof jQuery) {
+                return content;
+            } else {
+                return jQuery('<span/>').text(content);
+            }
         },
         _format_action: function(content) {
             if (this.format_action) {

Reply via email to