Raman-Katiyar commented on PR #21847:
URL: https://github.com/apache/echarts/pull/21847#issuecomment-7000610802

   Nice fix — using a function as the replacement avoids the `$`-pattern 
substitution, and the new tests cover the three sites well. I noticed the same 
`String.replace('{...}', value)` pattern with a plain-string replacement is 
still used in a few places where the substituted text is user-controlled, so 
the same mangling can still happen there. The clearest one is 
`src/component/legend/LegendView.ts:461`: `content = 
formatter.replace('{name}', name ...)` — `name` is the series name, so a series 
named e.g. `Sales $& Q1` would still render with `{name}` substituted back in. 
The same pattern is also in `src/util/format.ts` (`formatTplSimple`), 
`src/component/dataZoom/SliderZoomView.ts:1159` and 
`src/component/axisPointer/viewHelper.ts:184`, where the value can be a 
category/axis label. Would it make sense to apply the same `() => ...` form in 
those places too, or keep this PR scoped to axis/radar/geo?


-- 
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