Panoramasx opened a new pull request, #21787:
URL: https://github.com/apache/echarts/pull/21787

   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   - [ ] new feature
   - [ ] others
   
   ### What does this PR do?
   
   Preserves literal dollar sequences in chart titles, series names, and data 
item names when generating ARIA descriptions.
   
   ### Fixed issues
   
   Closes #21786.
   
   ## Details
   
   ### Before: What was the problem?
   
   With ARIA enabled, a chart titled `Revenue $&` receives an `aria-label` 
containing `Revenue {title}`. Similarly, `$$` becomes a single dollar sign, and 
a dollar sign followed by a backtick or single quote inserts surrounding 
template text.
   
   The same problem affects series names and data item names. The visible text 
and the accessibility description therefore disagree.
   
   ### After: How does it behave after the fixing?
   
   The existing template helper now supplies a callback returning 
`String(value)` to `String.prototype.replace`. Values are inserted literally, 
while existing placeholder matching and global replacement behavior are 
retained. There are no public API or type changes.
   
   For example, `Revenue $&` and `Revenue $$` remain unchanged in the generated 
description.
   
   ## Document Info
   
   - [x] This PR doesn't relate to document changes
   - [ ] The document should be updated later
   - [ ] The document changes have been made in apache/echarts-doc#xxx
   
   ## Misc
   
   ### Security Checking
   
   - [ ] This PR uses security-sensitive Web APIs.
   
   ### ZRender Changes
   
   - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
   
   ### Related test cases or examples to use the new APIs
   
   `test/ut/spec/series/aria-label.test.ts` exercises actual chart descriptions 
in EN and ZH locales, all four special replacement sequences, ordinary text, 
repeated and whitespace-padded placeholders, and numeric values including zero.
   
   ### Merging options
   
   - [x] Please squash the commits into a single one when merging.
   
   ### Other information
   
   Validation:
   
   - Before the fix: 9 regression failures and 2 ordinary-text passes.
   - After the fix: all 11 new tests pass.
   - `npm test -- --runInBand`: 27 suites and 205 tests pass.
   - `npm run build:lib` and `npm run checktype`: pass.
   - ESLint on both changed files and `git diff --check`: pass.
   - Full `npm run lint` reports 6 existing errors in 
`extension-src/bmap/BMapCoordSys.ts`. Running it with the original ARIA source 
restored produces the same errors; this PR does not change that extension.
   
   Tested on macOS with Node.js 22.23.3. No generated build files or dependency 
changes are included.
   


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