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
Showing
- .gitignore 2 additions, 0 deletions.gitignore
- Text/XHtml/Frameset.hs 2 additions, 2 deletionsText/XHtml/Frameset.hs
- Text/XHtml/Internals.hs 20 additions, 2 deletionsText/XHtml/Internals.hs
- Text/XHtml/Strict.hs 2 additions, 2 deletionsText/XHtml/Strict.hs
- Text/XHtml/Transitional.hs 2 additions, 2 deletionsText/XHtml/Transitional.hs
Loading
Please register or sign in to comment