Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Locked Figure Aria] Fix $ edge cases for spoken math aria labels #1874

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Commits on Nov 16, 2024

  1. [Locked Figure Aria] Fix $ edge cases for spoken math aria labels

    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.
    nishasy committed Nov 16, 2024
    Configuration menu
    Copy the full SHA
    3058e93 View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2024

  1. address PR comments

    nishasy committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    90c76cd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8a22f88 View commit details
    Browse the repository at this point in the history
  3. Use the new mathOnlyParser

    nishasy committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    93cfb8f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f71abc4 View commit details
    Browse the repository at this point in the history