gd2md-html icon indicating copy to clipboard operation
gd2md-html copied to clipboard

Explore converting simple tables to Markdown

Open evbacher opened this issue 6 years ago • 8 comments

We could potentially have an option to convert tables to Markdown. If there are complex tables, I suspect they will get mangled. If that's the case, you can just use HTML tables. I don't really want to add logic to determine if a table is simple enough to convert to Markdown, because that will add a lot of overhead (time and code).

evbacher avatar Mar 30 '18 00:03 evbacher

I was just noticing that the output of my tables was not Markdown, but HTML. I suppose this is a feature?

HughP avatar Nov 11 '19 20:11 HughP

It's a feature because HTML tables can handle just about anything that a Google Doc can do with tables. That's not true of Markdown tables. If I have time (haha :) I hope to investigate turning very simple tables into Markdown tables. But it's not a trivial fix, so for now, HTML tables.

evbacher avatar Nov 12 '19 00:11 evbacher

I just got here because I clicked "Markdown" when converting a table and got HTML code.

Totally understand why it's not a trivial fix, but maybe consider adding a comment in the conversion notes with a short explanation and pointing to this issue?

Something like:

Markdown tables are not currently supported. See: https://github.com/evbacher/gd2md-html/issues/22

georgebrindeiro avatar Mar 30 '20 23:03 georgebrindeiro

I'd gladly contribute, but: https://github.com/evbacher/gd2md-html/issues/37

georgebrindeiro avatar Mar 30 '20 23:03 georgebrindeiro

Hi George -- I'm happy to add a short message like that in the top comment.

And, no promises, but I am starting to explore open-sourcing as well.

evbacher avatar Mar 31 '20 15:03 evbacher

If there are tables, there will now be a note in the conversion comment at the top that all tables currently convert to HTML tables. I'm leaving this open in case someone gets motivated to try detecting simple tables and converting them to Markdown.

evbacher avatar Apr 01 '20 03:04 evbacher

Note to @georgebrindeiro: this addon is now open source.

evbacher avatar May 16 '20 16:05 evbacher

@georgebrindeiro: See #75 for more discussion about Markdown tables.

evbacher avatar Aug 06 '20 01:08 evbacher