Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Keep error Path when wrapping error list #37

Open
freizl opened this Issue · 2 comments

2 participants

@freizl

dfChildErrorList only list all error message without each error Path.
I think it is better to keep the Path, for instance, put the Path as a attribute of li element.

By doing this is just to be more flexible regrading customize error highlights.
For instance, utilize JavaScript to highlight error over each element.

-- A quick fix at my local
dfChildErrorListRef view = return $ errorList (viewErrors view)
errorList :: [(Path, Text)] -> [X.Node]
errorList []    = []
errorList errs  = [X.Element "ul" [] $ map makeError errs]
                  where makeError (p:_, e) = X.Element "li" [("data-error", p)] [X.TextNode e]

Since HTML 5 allow add customize attribute started with data-, I name data-error here.

Thanks.

@jaspervdj
Owner

Okay, I'm not sure if many people need this but I can (and will) put it in anyway since it should never get in the way.

@freizl

Great. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.