Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


duplicate attributes #2

Mistuke opened this Issue · 2 comments

2 participants


The way (!) is currently implemented allows duplicate attributes to occur inside an element. You won't notice a problem with most browsers since they are rather forgiving on these types of things.

instance ADDATTRS Html where
      (Html htmls) ! attr = Html (map addAttrs htmls)
              addAttrs (html@(HtmlTag { markupAttrs = attrs }) )
                              = html { markupAttrs = attrs ++ attr }
              addAttrs html = html

The problem is that when duplicate attributes occur, it in turn makes tools like haddock generate invalid xhtml.
According to [1] duplicate attributes are not allowed.
Or in a more specific case, haddock generates duplicate class
attributes <p class="caption" class="empty"> which according to
[2] should instead be <p class="caption empty">.

I'm reporting this to you rather than the haddock people because the
Html type is abstract. There's no way to modify existing attributes or
test for the existence of one. For the case of classes you can
probably solve it quite easily by just grouping them, but I'm not sure
if this is in general the case.


@cdornan cdornan was assigned

Thanks mistuke -- I am due to make new release RSN -- where I will try and close this out.


Cool, I'll keep an eye out for the release :)

@cdornan cdornan closed this
@ghc-mirror ghc-mirror referenced this issue in haskell/haddock

invalid xhtml being generated #186

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.