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.
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 ofli
element.By doing this is just to be more flexible regrading customize error highlights. For instance, utilize JavaScript to highlight error over each element.
Since HTML 5 allow add customize attribute started with
data-
, I namedata-error
here.Thanks.