avh4 / avh4/elm-format

Regex pattern attribute causing error

Open
#511 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Haskell
Stars
1.3k
Forks
147
PR merge metrics
No merged PRs in 30d

Description

I have a big html snippet generated by a tool ( http://mbylstra.github.io/html-to-elm/ ) and it took me a long time to discover what was crashing the elm-format.

Then I discovered that inside `Html.Attribute.pattern "[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$"` the character \ inside the string was crashing and it was almost impossible to discover because the error was showing at the beginning of the view function.

SSCCE:
https://ellie-app.com/NHJHZk7d44a1

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the crash with the SSCCE linked in the issue, focusing on the Html.Attribute.pattern string and its escaped character. Trace the formatter entry point that handles this expression; done means elm-format processes the snippet without crashing and reports errors at the relevant location.

Written by the indexing model from the issue text.

Assessment

Tech stack
elm
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.