Wrong token parse in rich text
- Dominant language
- TypeScript
- Stars
- 67.3k
- Forks
- 19.8k
- Avg merge
- 11d 14h
- Merged PRs (30d)
- 8
Description
### Version
5.1.1
### Steps to reproduce
```js
option = {
legend: {
formatter: '{a|{name}}',
textStyle: {
rich: {
a: {
width: 200
}
}
}
},
series: [
{
name: '访问来源',
type: 'pie',
data: [
{value: 1048, name: '搜索引擎{}'},
{value: 300, name: '视频广告'}
]
}
]
};
```
### What is expected?
No space in the '{}'
### What is actually happening?

And I have not found a work around yet.
### Discuss
1. Should the rich text delimiters (`{a|xxx}`) only available in `formatter` field or also enabled in data?
I think we probably can not restrict the delimiters only available in `formatter` (consider formatter can be a function).
That is, if data contains `'{a|xxx}'`, it also should be recognized as rich text delimiters.
2. Should we provide escaping for rich text delimiters?
I think it should. And we should better provide a util method to escape delimiters in data.
Contributor guide
Assessment
This issue has not been assessed yet.