Panoramasx opened a new issue, #21786:
URL: https://github.com/apache/echarts/issues/21786

   ### Version
   
   6.1.0; also reproduced on master at commit 
`34f4d927eafe251f26f63afd3aeefa30f2feba30`.
   
   ### Link to Minimal Reproduction
   
   
https://echarts.apache.org/examples/en/editor.html?c=pie-simple&version=6.1.0&code=PYBwLglsB2AEC8sDeAoW7YENoQLachgC5YAzTAGwGcBTAGjQ0jAppKVjBoA8wSByAEo0AbjWgBXGrAAkAMn6wAvgwxYAThEztY4zACNWAExJh1U5aoy1NNKiQDaqNWrABPEG1j8QEGvysXWGhMXC9%2BAGVKOwDGIKMCbVgnYNDwgEEA2BFKKRIAFgAmZQBdONKUJQBuFCA
   
   ### Steps to Reproduce
   
   1. Open the reproduction and run the chart option.
   2. Inspect the chart container's `aria-label` attribute after rendering. In 
the editor console, use `myChart.getDom().getAttribute('aria-label')`.
   3. The title is `Revenue $&`, but the generated description contains 
`Revenue {title}`.
   4. Repeat with `$$`, a dollar sign followed by a backtick, or a dollar sign 
followed by a single quote. These also alter the generated text. Series names 
and data item names are affected in the same way.
   
   The option used by the reproduction is:
   
   ```js
   option = {
       animation: false,
       title: { text: 'Revenue $&' },
       aria: { enabled: true },
       series: [{
           type: 'pie',
           name: 'Sales',
           data: [{ name: 'A', value: 42 }]
       }]
   };
   ```
   
   ### Current Behavior
   
   In an English locale chart, the generated description begins:
   
   ```text
   This is a chart about "Revenue {title}"
   ```
   
   With the Chinese locale, it begins:
   
   ```text
   这是一个关于“Revenue {title}”的图表。
   ```
   
   The visible title remains `Revenue $&`. `$$` is reduced to a single dollar 
sign, while dollar + backtick and dollar + single quote insert surrounding 
template text. The accessibility description therefore differs from the title 
or names supplied by the caller.
   
   ### Expected Behavior
   
   Titles, series names and data item names should be preserved literally in 
the generated accessibility description. For example, it should contain 
`Revenue $&`, and `$$` should remain two dollar signs.
   
   ### Environment
   
   - OS: macOS
   - Runtime: Node.js 22.23.3, Jest/jsdom
   - Framework: none
   
   Verified through chart instances in the project's unit-test environment, and 
separately with the official 6.1.0 build in an in-memory DOM attribute probe. 
The editor link provides the equivalent browser reproduction; no manual 
screen-reader test was performed.
   
   ### Any additional comments?
   
   The template helper in `src/visual/aria.ts` passes values directly as 
replacement strings to `String.prototype.replace`, which interprets special 
dollar sequences. Using a replacement callback preserves the text literally.
   
   I have prepared a fix with regression tests covering both built-in EN and ZH 
locales, all four dollar sequences, repeated and whitespace-padded 
placeholders, and numeric values.
   


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