Skip to content
New issue

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

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

Already on GitHub? # to your account

Earmark crashes (like EarmarkParser) on "\\[{:}" #501

Closed
RobertDober opened this issue Jul 8, 2024 · 0 comments
Closed

Earmark crashes (like EarmarkParser) on "\\[{:}" #501

RobertDober opened this issue Jul 8, 2024 · 0 comments
Assignees
Labels

Comments

@RobertDober
Copy link
Collaborator

RobertDober/earmark_parser#154

here is the crash in Earmark master

Generated earmark app
Interactive Elixir (1.17.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> EarmarkParser.as_ast("\\[{:}")
** (UndefinedFunctionError) function EarmarkParser.as_ast/1 is undefined (module EarmarkParser is not available)
    EarmarkParser.as_ast("\\[{:}")
    iex:1: (file)
iex(1)> Earmark.as_ast("\\[{:}")
** (FunctionClauseError) no function clause matching in Earmark.Parser.Helpers.AstHelpers.augment_tag_with_ial/2

    The following arguments were given to Earmark.Parser.Helpers.AstHelpers.augment_tag_with_ial/2:

        # 1
        ["["]

        # 2
        %{}

    Attempted function clauses (showing 2 out of 2):

        def augment_tag_with_ial([{t, a, c, m} | tags], atts)
        def augment_tag_with_ial([], _atts)

    (earmark 1.4.46) lib/earmark_parser/helpers/ast_helpers.ex:33: Earmark.Parser.Helpers.AstHelpers.augment_tag_with_ial/2
    (earmark 1.4.46) lib/earmark_parser/ast/inline.ex:258: Earmark.Parser.Ast.Inline.converter_for_inline_ial/1
    (elixir 1.17.1) lib/enum.ex:4343: Enum.find_value_list/3
    (earmark 1.4.46) lib/earmark_parser/ast/inline.ex:36: Earmark.Parser.Ast.Inline._convert/4
    (earmark 1.4.46) lib/earmark_parser/ast_renderer.ex:32: Earmark.Parser.AstRenderer.render_block/3
    (earmark 1.4.46) lib/earmark_parser/ast_renderer.ex:23: Earmark.Parser.AstRenderer._render/3
    (earmark 1.4.46) lib/earmark_parser.ex:594: Earmark.Parser.as_ast/2
    iex:1: (file)

@amit-chaudhari1 if ok with you I (ab)use me right to assign it to myself as the liklhood that I can backport the fix is high

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant