Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newlines added in Markdown tables #93

Open
morsssss opened this issue Jun 21, 2021 · 3 comments
Open

Newlines added in Markdown tables #93

morsssss opened this issue Jun 21, 2021 · 3 comments

Comments

@morsssss
Copy link

I'm a big fan of Docs to Markdown. Thanks for making this! I used it at work, and now I'm using it for my music blog.
In the past, I've created tables in Docs, then let your plugin convert those to HTML. I thought I'd try using Markdown tables instead, then still running my Doc through your plugin to convert links, headings, and the like. Unfortunately, the plugin adds newlines inside my markdown tables.

So, for example, this:

| | | |
| - | - | - |
| F# E D | F# E D C# | E |
| Em | Em | A |

becomes this:

| | | |

| - | - | - |

| F# E D | F# E D C# | E |

| Em | Em | A |

I can remove the spaces afterwards using regexes, but I wish they weren't added in the first place.

Thank you!

@evbacher
Copy link
Owner

evbacher commented Jun 21, 2021

Thanks -- I'm glad you like using Docs to Markdown!

I can understand your frustration with the added newlines. Docs to Markdown assumes that every paragraph in a Google doc is a paragraph in the output, so it adds a newline to separate them.

However, it might be nice to allow you to specify sections that should not be converted at all. While I'm reluctant to add too much markup, we could add something that signifies a verbatim block that would not get any processing at all. Then you could add Markdown tables or any other kind of markup you'd like in your final output. I'll tinker with that a bit.

Perhaps something like this (just thinking out loud here - no final design yet). the .v is for verbatim:

.v
| | | |
| - | - | - |
| F# E D | F# E D C# | E |
| Em | Em | A |
./v

@morsssss
Copy link
Author

Well, I wouldn't say I'm frustrated. Mostly I'm grateful to have this add-on! I like writing simple regexes, so it's kind of fun to remove the extra spaces afterwards.

Would it ever make sense to detect markdown tables or similar entities and not treat each line in such an entity as a different object?

Otherwise, or, really, in any case, markers for "don't process this bit" or "this is raw text" seem like a useful feature to me in any case. I do rely on such markers in other contexts - like Prettier.

Thanks!

@r0ze-at-github
Copy link

r0ze-at-github commented Aug 10, 2023

Better would be if tables would be converted to actual markdown tables. And yes markdown tables are limited, but for most use cases that is all anyone wants and right now tables can't be converted to markdown and writing markdown tables don't work either so the only option is to manual fix the tables after every run :(

If someone wants a fancy table they can use html tables, but for most tables are just broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants