Skip to content

myst_substitutions don't allow for dashed names #1007

Description

@dylanh724

What version of myst-parser are you using?

4.0.0

What version dependencies are you using?

docutils==4.0.0
sphinx==8.1.3

What operating system are you using?

Windows

Describe the Bug

When declaring a substitution with a key that contains a dash, like foo-bar, building results in a warning:

WARNING: Substitution error:UndefinedError: 'foo' is undefined [myst.substitution]

Notice how it doesn't even detect the -bar part of the sub. Renaming to foo_bar works around this bug.

...However, we shouldn't have to (worked fine in rst_prolog when we used rst).

Expected Behavior

I should be able to declare foo-bar myst_substitution key without issues (with a dash).

To Reproduce

In conf.py:

myst_substitutions = {
    "foo-bar": "Foobar",
}

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions