nytai commented on code in PR #26189:
URL: https://github.com/apache/superset/pull/26189#discussion_r1417909415


##########
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,
-        ' ',
-      );
+      sizerRef.current.innerHTML = (currentTitle || placeholder)

Review Comment:
   do we want to sanitize (ie, remove) html or just escape it? I think the 
purpose of this code is to render the title to the DOM so we can measure how 
much space it takes up, so we probably want to escape it. 
   
   Looking at an escape-html lib, it's pretty basic. Eg 
https://github.com/component/escape-html/blob/master/index.js 
   
   Happy to update the PR to use this lib if we think it's best, but... you 
know the joke about node modules 
   
   
![image](https://github.com/apache/superset/assets/10255196/65717c9c-ae6b-4a3c-8d8e-5575a5956da2)
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to