Skip to content

Editor: quantities inside {} are not highlighted #495

Description

@dubadub

Found while reviewing the fix for #490.

static/js/src/cooklang-mode.js returns "measurement" for the quantity part of {200%g} (and "unit" only after %). measurement is not a Lezer highlight tag, so CodeMirror logs "Unknown highlighting tag measurement" and the number gets no class or colour; only the unit is styled.

Fix: map the quantity to a real tag (e.g. t.number) and give it a .cm-cook-quantity class in static/css/input.css on a token colour.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions