jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.55k stars 3.38k forks source link

epub writer: <col> should be within <colgroup> in tables #877

Closed MichaelKofler closed 10 years ago

MichaelKofler commented 11 years ago

I tried to publish an ebook at Apple using the iTunes Producer. This program complained that <col> elements where not allowed within a table. I.e.

<table><col xxx/><col yyy/>

is wrong. I manually changed the xhtml file to

<table><colgroup><col xxx/><col yyy/> </colgroup>

and it was OK. Not sure if there is an epub standard for this.

Markdown sample to produce the table which triggers this error:

---------------- ---------------------------------------------
**row1**         bla

**row2**         bla bla
---------------------------------------------------------------
jgm commented 11 years ago

As far as I can see, the output pandoc produces is valid xhtml. There is no requirement that col elements be nested inside a colgroup. I've verified this by validating pandoc's output at http://validator.w3.org/check. If this is wrong, please supply evidence that the xhtml spec requires col elements to be inside colgroup. Otherwise, it seems to me that this is a bug in iTunes Producer, not pandoc.

MichaelKofler commented 11 years ago

I just re-read the xhtml specification. You are of course right. I'll try to complain at Apple ...

omerida commented 10 years ago

Just wanted to mention that epubcheck also complains about col elments not within a colgroup. It didn't raise that error for me when I switched to using a pipe delimited table.

omerida commented 10 years ago

Although, I just ran the generated html for my epub through the W3C's validator. Validator gave the following error:

XHTML element col not allowed as child of XHTML element table in this context. (Suppressing further errors from this subtree.)

For this HTML:

…s.</p><table><col style="width: 51%" /><col style="width: 47%" /><tbody><tr cl…

Details about the col element link to an HTML5 document

http://www.w3.org/html/wg/drafts/html/master/single-page.html#the-col-element

omerida commented 10 years ago

Thank you! Looking forward to the next release.