Skip to content

Mathjax single dollar sign delimiter configuration causes unintentional math rendering in abstracts #6263

Description

@doana

Describe the bug

The current mathjax configuration provided in client-math.service.ts configures mathjax to use a number of delimiters to denote a math formula for rendering. At the moment, a single dollar sign ($) is one option that is configured by default as a delimiter. This default configuration causes issues when mathjax is enabled and an abstract uses any two dollar signs anywhere in the metadata field, creating instances where content is inadvertently rendered as formula.

To Reproduce

Steps to reproduce the behavior:

  1. Enable mathjax in your UI configuration file
  2. Create a new item or edit an existing item, providing the following in the dc.description.abstract metadata field:
    Last Sunday I bought an ice cream cone for $2. Then we went to the market down the road and they were selling their ice cream cones for $3! What a terrible thing!.
  3. View your item and note that all the text between the two dollar signs has been interpreted as a mathematical formula.

Expected behaviour

In my opinion, the single dollar sign delimiter is too easy to use unintentionally and should be disabled. There are still two other delimiters that users could use to insert a formula in a more intentional way.

Alternatively, it would be nice for site admins to be able to pass in delimiter configuration as part of your dspace-angular configuration to allow us to override this behaviour without needing to maintain a local customization of the code.

I experienced this on DSpace 8, but the mathjax configuration seems the same in all the other versions as well.

Thanks!
-Adam

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds triageNew issue needs triage and/or scheduling

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions