You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ta...@apache.org on 2023/12/05 22:40:11 UTC

(superset) branch tai/fix-title created (now 6394d2715d)

This is an automated email from the ASF dual-hosted git repository.

tai pushed a change to branch tai/fix-title
in repository https://gitbox.apache.org/repos/asf/superset.git


      at 6394d2715d fix(dashboard): title formatting

This branch includes the following new commits:

     new 6394d2715d fix(dashboard): title formatting

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(superset) 01/01: fix(dashboard): title formatting

Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tai pushed a commit to branch tai/fix-title
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 6394d2715d9fc32842a4a12f5705e94c7e4f3b26
Author: Tai Dupree <td...@gmail.com>
AuthorDate: Tue Dec 5 14:36:04 2023 -0800

    fix(dashboard): title formatting
---
 .../src/components/DynamicEditableTitle/index.tsx              | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/superset-frontend/src/components/DynamicEditableTitle/index.tsx b/superset-frontend/src/components/DynamicEditableTitle/index.tsx
index 86205bebc2..9c96a988de 100644
--- a/superset-frontend/src/components/DynamicEditableTitle/index.tsx
+++ b/superset-frontend/src/components/DynamicEditableTitle/index.tsx
@@ -113,10 +113,12 @@ export const DynamicEditableTitle = ({
   // then we can measure the width of that span to resize the input element
   useLayoutEffect(() => {
     if (sizerRef?.current) {
-      sizerRef.current.innerHTML = (currentTitle || placeholder).replace(
-        /\s/g,
-        '&nbsp;',
-      );
+      sizerRef.current.innerHTML = (currentTitle || placeholder)
+        .replaceAll('&', '&amp;')
+        .replaceAll('<', '&lt;')
+        .replaceAll('>', '&gt;')
+        .replaceAll('"', '&quot;')
+        .replaceAll("'", '&#039;');
     }
   }, [currentTitle, placeholder, sizerRef]);