-
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 Labels + Aria] Create math only parser to help parse TeX how …
…we want (#1890) ## Summary: We want to be able to parse a string meant for TeX into its most basic essential parts. To do this, we are creating a `mathOnlyParser()` parser. Using the default `parse()` function from SimpleMarkdown breaks up text into too many sections, and parsing from scratch can get very complicated. The ideal way to do this is to use the existing `parserFor()` function from SimpleMarkdown that lets us customize the parser. This will be used in - Generating the TeX for Locked Labels and Locked Figure labels so that it shows up correctly on the graph. Non-TeX should show up with regular text styling and allow spaces. - Generating the aria label for locked figures with TeX labels. The speech rule engine will only be run on the math sections of the parsed output. Issue: https://khanacademy.atlassian.net/browse/LEMS-2548 (and also https://khanacademy.atlassian.net/browse/LEMS-2591) ## Test plan: `yarn jest packages/perseus/src/widgets/interactive-graphs/utils.test.ts` Author: nishasy Reviewers: nishasy, anakaren-rojas, #perseus, benchristel, catandthemachines Required Reviewers: Approved By: anakaren-rojas Checks: ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Check builds for changes in size (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: #1890
- Loading branch information
Showing
4 changed files
with
216 additions
and
3 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": patch | ||
--- | ||
|
||
[Locked Labels + Aria] Create math only parser to help parse TeX how we want |
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