snarkdown
snarkdown copied to clipboard
Feature/table
Added table functionalty with optional header cells. I'm not sure if it's the shortest solution but it works.
Looks good - we'll definitely need to inline the reduce since that's costly. Also the spacing seems off - there's an .editorconfig
in this repo that should set your editor to tabs in all *.js files (requires the editorconfig plugin for Atom if you use that).
@developit Sorry about the spacing didn't notice it. I removed the spacing issue. I'll look into optimization tomorrow.
Awesome, thanks!
@developit The reduce function doesnt seem that costly in this situation: http://jsben.ch/#/Coso0
This evening I'll replace the v.trim() with parse(v), then it should allow inline styling
@developit might have found a way to minimize it, by combining the header and content. I'll try it out later.
@developit Shaved off 10 bytes. I think I reached my personal limit.
LGTM!
Looking good! I'll take a look at this locally.
Side note on reduce: I'm seeing vast speed improvements in .reduce since node v0.12/v4 days. Extra mem allocs are mostly cleaned up in the faster GC pass. Both for string & array return types!
The only reason I avoid now is for closer WASM compat.
Either way, great work @ShynRou - super excited to see this get added!
Still not merged... I have written my own tiny markdown parser in the meantime. So if you need Table or recursive List support: https://github.com/shynrou/micro-down
@developit what help do you need to get this merged? I may help and I'm pretty interested on having this merged. :)
+1 !!