public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Converting HTML tables to Markdown
@ 2023-05-28 12:04 mails.lists.2012-1-rRloVJBGZzogAv4oPwG0Al6hYfS7NtTn
       [not found] ` <3b196e5a-93f8-77dd-366d-9bcff734ce64-8DM0qNeCP8OsTnJN9+BGXg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: mails.lists.2012-1-rRloVJBGZzogAv4oPwG0Al6hYfS7NtTn @ 2023-05-28 12:04 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 1666 bytes --]

Hi all,


I'm a bit clueless with HTML table conversion at the moment.

I currently use pandoc 3.1.2 on x64 and I'm converting some HTML dumps 
into Markdown (gfm).

I read the manpage, the web site docs and googled, but apparently missed 
the crucial pointer so far.


In many cases, by default tables end up as raw HTML in the Markdown output.

I tried to circumvent this by using

     pandoc -f html -t gfm-raw_html

However, instead of the actual table, only the following text is being 
output then:

     [TABLE]

That's obviously not what I want.

If I add something like

-native_divs-native_spans-fenced_divs-bracketed_spans

to my output format spec, nothing is output any more for my affected test file, i.e. the output stays totally empty.


I just want my HTML table to be converted into a corresponding Markdown 
table, at least as good as it can be expressed in Markdown - I'm aware 
that HTML tables allow for more features and in many cases may not be 
converted perfectly or not without some information loss or adaptions.

However just getting the word "TABLE" is the output is too much 
simplified in my eyes, with all table content being completely lost...


Best regards,

   Gunter

-- 
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/3b196e5a-93f8-77dd-366d-9bcff734ce64%40ohrner.net.

[-- Attachment #2: Type: text/html, Size: 3510 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Converting HTML tables to Markdown
       [not found] ` <3b196e5a-93f8-77dd-366d-9bcff734ce64-8DM0qNeCP8OsTnJN9+BGXg@public.gmane.org>
@ 2023-05-28 21:10   ` 'William Lupton' via pandoc-discuss
  0 siblings, 0 replies; 2+ messages in thread
From: 'William Lupton' via pandoc-discuss @ 2023-05-28 21:10 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 2791 bytes --]

I think that your HTML must contain tables that cannot be represented in
gfm and therefore are left as HTML (which is valid gfm I believe?). When
you specify -raw_html you are forbidding pandoc from doing this, so I guess
this is why it outputs [TABLE]. As for the empty output in the last case,
when I tried it I got a "The extension native_divs is not supported for
gfm" error, which is presumably why no output was generated.

On Sun, 28 May 2023 at 13:04, <mails.lists.2012-1-rRloVJBGZzogAv4oPwG0Al6hYfS7NtTn@public.gmane.org> wrote:

> Hi all,
>
>
> I'm a bit clueless with HTML table conversion at the moment.
>
> I currently use pandoc 3.1.2 on x64 and I'm converting some HTML dumps
> into Markdown (gfm).
>
> I read the manpage, the web site docs and googled, but apparently missed
> the crucial pointer so far.
>
>
> In many cases, by default tables end up as raw HTML in the Markdown output.
>
> I tried to circumvent this by using
>
>     pandoc -f html -t gfm-raw_html
>
> However, instead of the actual table, only the following text is being
> output then:
>
>     [TABLE]
>
> That's obviously not what I want.
>
> If I add something like
>
>     -native_divs-native_spans-fenced_divs-bracketed_spans
>
> to my output format spec, nothing is output any more for my affected test file, i.e. the output stays totally empty.
>
>
> I just want my HTML table to be converted into a corresponding Markdown
> table, at least as good as it can be expressed in Markdown - I'm aware that
> HTML tables allow for more features and in many cases may not be converted
> perfectly or not without some information loss or adaptions.
>
> However just getting the word "TABLE" is the output is too much simplified
> in my eyes, with all table content being completely lost...
>
>
> Best regards,
>
>   Gunter
>
> --
> 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/3b196e5a-93f8-77dd-366d-9bcff734ce64%40ohrner.net
> <https://groups.google.com/d/msgid/pandoc-discuss/3b196e5a-93f8-77dd-366d-9bcff734ce64%40ohrner.net?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAEe_xxgyB95nEYoOziSr84wfGNaj8bZNNo07vVORpF0KqQO7UQ%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 4531 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-28 21:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-28 12:04 Converting HTML tables to Markdown mails.lists.2012-1-rRloVJBGZzogAv4oPwG0Al6hYfS7NtTn
     [not found] ` <3b196e5a-93f8-77dd-366d-9bcff734ce64-8DM0qNeCP8OsTnJN9+BGXg@public.gmane.org>
2023-05-28 21:10   ` 'William Lupton' via pandoc-discuss

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