public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: Gary Glass
	<garyglassphotography-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	pandoc-discuss
	<pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: File splitting bug
Date: Tue, 06 Jul 2021 09:19:23 -0700	[thread overview]
Message-ID: <m21r8bjtys.fsf@MacBook-Pro-2.hsd1.ca.comcast.net> (raw)
In-Reply-To: <fd258aa4-a793-4d12-bb15-3f55fc2d0e4an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


Thank you for the minimal test case!
Actually one can see the issue just with

pandoc --section-divs bug.md

At the end there is

</div>
</section>
</section>

where you'd want

</section>
</div>
</section>

The difference is that, with the colgroup, the <div> tags are
being parsed as raw HTML blocks, while without it, we get a
native Div in the AST (which is what we want in this case).

Somehow the colgroup is interfering with parsing of the native
Div.

If you don't mind reporting this at
https://github.com/jgm/pandoc/issues (including this information)
it will help us keep track.  Looking at the code, I currently
have no idea why this is happening.

Gary Glass <garyglassphotography-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Here's the simplest file I could make to repro the issue. The pandoc 
> command is very simple:
>
> pandoc --output=bug.epub --to=epub3 bug.md
>
> It produces an HTML file with a mismatched section tag.
>
> If you comment out the colgroup, the output is fine.
>
> On Friday, July 2, 2021 at 6:55:27 PM UTC+2 John MacFarlane wrote:
>
>>
>> Pandoc won't emit invalid HTML itself, but if you include
>> invalid HTML, it just dutifully passes it through verbatim.
>>
>> Checking HTML syntax is not pandoc's job. Use epubcheck
>> to verify the EPUB if you like.
>>
>> Gary Glass <garyglassp...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>
>> > I figured out the source of the issue. I had an html table in the 
>> markdown 
>> > and I added a colgroup to the table. The colgroup caused the problem. 
>> > Removing it made it go away.
>> >
>> > Colgroup is not a commonly used tag (in my experience), but I think the 
>> bug 
>> > is that pandoc shouldn't just emit invalid epub html when the source 
>> code 
>> > is valid, even if it doesn't know what to do with it. Report an error or 
>> > something! The html looked something like this:
>> >
>> > <table>
>> > <colgroup>
>> > <col />
>> > <col style="width: 33%;" />
>> > <col />
>> > </colgroup>
>> > <tr>
>> > <td>...</td>
>> > <td>...</td>
>> > <td>...</td>
>> > </tr>
>> > ...
>> > </table>
>> >
>> > On Thursday, July 1, 2021 at 5:57:57 PM UTC+2 John MacFarlane wrote:
>> >
>> >>
>> >> No ideas. We'd have to see the actual files to know more.
>> >>
>> >>
>> >
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> Groups "pandoc-discuss" group.
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> > To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/pandoc-discuss/38ac5d4c-8cba-4c23-a313-bf81e79779e7n%40googlegroups.com
>> .
>>
>
> -- 
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/fd258aa4-a793-4d12-bb15-3f55fc2d0e4an%40googlegroups.com.
> # header 1
>
> <div>
>
> ## header 2
>
> <table>
> 	<colgroup>
> 		<col />
> 		<col />
> 		<col />
> 	</colgroup>
> 	<thead>
> 		<tr>
> 			<th>a</th>
> 			<th>b</th>
> 			<th>c</th>
> 		</tr>
> 	</thead>
> 	<tbody>
> 		<tr>
> 			<td>xxx</td>
> 			<td>xxx</td>
> 			<td>xxx</td>
> 		</tr>
> 	</tbody>
> </table>
>
> </div>


  parent reply	other threads:[~2021-07-06 16:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01  6:46 Gary Glass
     [not found] ` <297bc662-7841-4423-bcbb-534e99bbba09n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-07-01 15:57   ` John MacFarlane
     [not found]     ` <m21r8ijabs.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-07-02  7:07       ` Gary Glass
     [not found]         ` <38ac5d4c-8cba-4c23-a313-bf81e79779e7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-07-02 16:55           ` John MacFarlane
     [not found]             ` <m2o8bkveog.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-07-06  6:31               ` Gary Glass
     [not found]                 ` <fd258aa4-a793-4d12-bb15-3f55fc2d0e4an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-07-06 16:19                   ` John MacFarlane [this message]
     [not found]                     ` <m21r8bjtys.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-07-06 16:31                       ` John MacFarlane
     [not found]                         ` <m2mtqzieuq.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-07-06 17:26                           ` John MacFarlane
     [not found]                             ` <m2k0m3icb1.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-07-07  7:30                               ` Gary Glass
     [not found]                                 ` <5d588eaf-0fd8-4023-8296-b9748189593cn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-07-07 16:47                                   ` John MacFarlane
     [not found]                                     ` <m27di2ul3e.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-07-09  5:56                                       ` Gary Glass
     [not found]                                         ` <53332f68-2c48-4416-91b8-8e34395d0859n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-07-09 18:34                                           ` John MacFarlane
     [not found]                                             ` <m2a6mvtjy3.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-07-09 19:57                                               ` Gary Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m21r8bjtys.fsf@MacBook-Pro-2.hsd1.ca.comcast.net \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@public.gmane.org \
    --cc=garyglassphotography-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).