Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

duplicate attributes #2

Closed
Mistuke opened this Issue · 2 comments

2 participants

@Mistuke

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)
        where
              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.

[1] http://www.w3.org/WAI/GL/WCAG20-TECHS/H94.html
[2] http://www.w3.org/TR/html4/struct/global.html#h-7.5.2

@cdornan cdornan was assigned
@cdornan
Collaborator

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

@Mistuke

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

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

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.