-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Locked Figure Aria] Fix $ edge cases for spoken math aria labels (#1874
) ## Summary: I received a couple suggestions in PR #1854. I'm implmementing them here: - Wrote a helper function that joins labels together so that we don't have to duplicate that code for every single locked figure. - Stopped calling `generateSpokenMathDetails()` on the whole aria string for the locked figure. Instead, it's now being called within the new helper function so that the labels can individually be converted, and we don't have to worry about the edge case with two different labels having dollar signs and causing all the content in between to be counted as TeX when it shouldn't. - Handled the case with a lone unescaped dollar sign, which should not count as TeX. Note: The lone unescaped dollar isn't handled for the TeX inside the graph itself yet. This will be in the next PR. Issue: https://khanacademy.atlassian.net/browse/LEMS-2548 ## Test plan: `yarn jest` Storybook - http://localhost:6006/?path=/story/perseuseditor-widgets-interactive-graph--mafs-with-locked-figure-labels-all-flags - Add two visible labels to the point, with one having "$1 and" as the label and the other having "$1" as the label. - Press the autogenerate button and confirm that the "and" is normal and not "a n d". Also confirm that the dollar signs show up normally. - Add two TeX labels and confirm that the auto-generated text is as expected. - Repeat for all the other locked figures. Author: nishasy Reviewers: benchristel, nishasy, catandthemachines, anakaren-rojas Required Reviewers: Approved By: benchristel, catandthemachines Checks: ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ gerald Pull Request URL: #1874
- Loading branch information
Showing
15 changed files
with
221 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@khanacademy/perseus-editor": patch | ||
--- | ||
|
||
[Locked Figure Aria] Fix $ edge cases for spoken math aria labels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.