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

markdown for table is not working #18

Closed
zk4 opened this issue Apr 26, 2014 · 2 comments
Closed

markdown for table is not working #18

zk4 opened this issue Apr 26, 2014 · 2 comments

Comments

@zk4
Copy link

zk4 commented Apr 26, 2014

markdown for table is not working in evernote.
like this

|Year | Temperature (low) | Temperature (high) |
| 1900 | -10 | 25 |
| 1910 | -15 | 30 |
| 1920 | -10 | 32 |
| 1920 | -10 | 32 |
| 1920 | -10 | 32 |
| 1920 | -10 | dd2 |

or this

og | bird | cat
:-- | :--: | --:
foo | foo  | foo
bar | bar  | bar
baz | baz  | baz

is that a bug?

@bordaigorl
Copy link
Owner

This is a limitation of the markdown converter the plugin uses.
Tables are not part of standard markdown and are only supported by extras with a multitude of different syntaxes.

There are two workarounds:

  1. The converter the plugin uses supports WikiTables which uses a different syntax from your examples but could be helpful. This extra is not currently enabled by default in the plugin but I can show you how to manually enable and I can update it so that the user has a choice through the settings
  2. HTML tables are supported. Just put <table> and </table> in a single line to enclose the table and put valid HTML inside (use <tr> and <td> to create rows and cells). If you wish to use markdown in the cells just use <table markdown="1">.

@bordaigorl
Copy link
Owner

@cubase01 I've just pushed to master a version which can support Wiki tables.

To enable the extension all you have to do is set "wiki_tables": true in your Evernote.sublime-settings file and then something like this:

|| *Year* || *Temperature (low)* || *Temperature (high)* ||
|| 1900 || -10 || 25 ||
|| 1910 || -15 || 30 ||
|| 1920 || -10 || 32 ||
|| 1930 || _N/A_ || _N/A_ ||
|| 1940 || -2 || 40 ||

gets turned into this

Year Temperature (low) Temperature (high)
1900 -10 25
1910 -15 30
1920 -10 32
1930 N/A N/A
1940 -2 40

The style can be controlled via the inline_css settings (specifically using the table, td, tr, tr:odd and tr:even keys). The default Evernote.sublime-settings file contains predefined styles that mimic GitHub tables' appearances.

Obviously, if you modify the table from other clients you will loose the original wiki-tables textual formatting and will get a raw HTML table instead on open.

As soon as I find the time to test and document this, I'll publish a new release on Package Control.

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

No branches or pull requests

2 participants