Skip to content
Snippets Groups Projects
Commit 5c08c761 authored by cdornan's avatar cdornan
Browse files

Add CHANGEATTRS and htmlAttrPair

Mistuke has pointed out that (!) does not allow attributes to be added
to a general (X)HTML tag while taking account of the attributes that
are already defined by the tag [1]. This can make it hard to generally
extend tags with attributes while even being sure that correct (X)HTML
is being generated (the standard prohibits the duplication of
attributes[2]).

In order to minimize disruption the existing interface has been
extended with an alternative class to `ADDATTRS` called `CHANGEATTRS`
and a deconstructor function, `htmlAttrPair`, for analysing the
(abstract) `HtmlAttr` type. With `CHANGEATTRS` a function is used to
transform the existing attributes (which can now be analysed with
`htmlAttrPair`) rather than being passed a list of attributes to add
to an HTML tag as is the case with `ADDATTRS`.

[1] https://github.com/haskell/xhtml/issues/2

[2] http://www.w3.org/WAI/GL/WCAG20-TECHS/H94.html
parent 6b666b27
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment