-
Notifications
You must be signed in to change notification settings - Fork 612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Escape Quotes in tooltip title
#9019
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an example in examples/specs
to show that this really does make it renderable?
@@ -88,7 +88,7 @@ export function tooltipData( | |||
}; | |||
|
|||
const title = fieldDef.title || defaultTitle(fieldDef, formatConfig); | |||
const key = array(title).join(', '); | |||
const key = array(title).join(', ').replaceAll(/"/g, '\\"'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, do we not have a utility method for this already? Does this problem not happen for other texts, axis labels or titles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see one, but maybe I didn't look in the right place. I'm not sure the other areas have the same problem since this one specifically generates a dictionary rather than acts as a value.
Currently titles such as
"\"mytitle\""
will cause the editor to break because it generates fields that look like:This PR escapes quotes to allow this case to pass.