speced / bikeshed

:bike: A preprocessor for anyone writing specifications that converts source files into actual specs.
https://speced.github.io/bikeshed
Creative Commons Zero v1.0 Universal
1.1k stars 200 forks source link

auto generated a-tags in abstract don't work #1230

Closed fergald closed 6 years ago

fergald commented 6 years ago

E.g. in css-shadow-parts-1 the following input

Abstract: This specification defines the ''::part()'' and ''::theme()'' pseudo-elements on <a>shadow hosts</a>, allowing <a>shadow hosts</a> to selectively expose chosen elements from their <a>shadow tree</a> to the outside page for styling purposes.

produces the following output

<meta content="This specification defines the &apos;&apos;::part()&apos;&apos; and &apos;&apos;::theme()&apos;&apos; pseudo-elements on <a>shadow hosts</a>, allowing <a>shadow hosts</a> to selectively expose chosen elements from their <a>shadow tree</a> to the outside page for styling purposes." name="abstract">

Which has several empty <a> tags.

Where this hurts is that the automatic diff tool pr-preview (which works fine if I remove the a-tags from the abstract).

Spec.fixText seems to be where the action is here but I don't know enough about it to hazard a fix but I guess the desired output is something like

<a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-shadow-root" id="ref-for-concept-shadow-root②">shadow root</a>

tabatkins commented 6 years ago

Can you comment more on what the actual issue is? This is just the <meta name=abstract> element, not the actual visible abstract. It just takes the literal text that you specified in the Abstract metadata and spams it in; any markup you use in your Abstract is similarly spammed in there.

If you wanted it to match the final output HTML that showed up in the abstract, I could potentially do that, but it would be a dramatically different architecture. What problems is this causing in pr-preview?

fergald commented 6 years ago

bikeshed spec w3c/csswg-drafts/css-shadow-parts-1/Overview.bs

produces the following

<meta content="This specification defines the &apos;&apos;::part()&apos;&apos; and &apos;&apos;::theme()&apos;&apos; pseudo-elements on <a>shadow hosts</a>, allowing <a>shadow hosts</a> to selectively expose chosen elements from their <a>shadow tree</a> to the outside page for styling purposes." name="abstract">

HTML differ chokes on the unescaped "<" in the attribute string

E.g.

https://services.w3.org/htmldiff?doc1=https%3A%2F%2Fpr-preview.s3.amazonaws.com%2Ffergald%2Fcsswg-drafts%2Fpull%2F2%2F8177d6a.html&doc2=https%3A%2F%2Fpr-preview.s3.amazonaws.com%2Ffergald%2Fcsswg-drafts%2Fpull%2F2%2F8177d6a.html

tabatkins commented 6 years ago

Huh, that's a bug in htmldiff. There's nothing wrong with a < in attribute values.

fergald commented 6 years ago

Actually it seems like html tidy is the problem

https://infohound.net/tidy/tidy.pl?_function=tidy&_url=https%3A%2F%2Fpr-preview.s3.amazonaws.com%2Ffergald%2Fcsswg-drafts%2Fpull%2F2%2F8177d6a.html&_html=&_file=&alt-text=&doctype=auto&drop-empty-paras=y&fix-backslash=y&fix-bad-comments=y&fix-uri=y&join-styles=y&lower-literals=y&ncr=y&new-blocklevel-tags=&new-empty-tags=&new-inline-tags=&new-pre-tags=&output-xhtml=y&quote-ampersand=y&quote-nbsp=y&indent=auto&indent-spaces=2&tab-size=4&wrap=90&wrap-asp=y&wrap-jste=y&wrap-php=y&wrap-sections=y&ascii-chars=y&char-encoding=ascii&input-encoding=latin1&output-bom=auto&output-encoding=ascii&_output=warn

Not the differ itself (running htmldiff.pl on the file seems to be no problem). I'm not sure how that service is set up. I'll try bug the listed maintainer.

That said, empty tags in the metadata don't seem useful.

tabatkins commented 6 years ago

Woah, huh, where's it got that doctype from? It might legit be wrong in xhtml, but this should all be html5 doctype

fergald commented 6 years ago

I've emailed htmldiff and htmltidy maintainers so see if we can get this fixed up.

fergald commented 6 years ago

htmldiff has been fixed!

tabatkins commented 6 years ago

:+1: