Skip to content

Explicit prefix when writing references on MinML #2

Description

@ranfdev

I'm implementing a parser for MinML in typescript.
It's mostly done, but it doesn't recognize references containing symbols like - and +.

I could fix that by using backtracking, but I think it would be nicer to keep the parser linear with the ability to lookahead 3 chars.

The following cases, as far as I know, require backtracking to decide how to parse them:
[-[comment]] maps to []
[---] maps to "\u2014"
[----] maps to [----]
[ldquo] maps to some html code.

If references explicitly required a prefix like ., the previous cases wouldn't require backtracking and they would become:
[-[comment]] maps to []
.[---] maps to \u2014
[----] maps to [----]
.[ldquo] maps to some html code.

I feel the brackets are too overloaded and that the syntax .[reference] would bring some clarity.

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