jonschlinkert / remarkable

Markdown parser, done right. Commonmark support, extensions, syntax plugins, high speed - all in one. Gulp and metalsmith plugins available. Used by Facebook, Docusaurus and many others! Use https://github.com/breakdance/breakdance for HTML-to-markdown conversion. Use https://github.com/jonschlinkert/markdown-toc to generate a table of contents.
https://jonschlinkert.github.io/remarkable/demo/
MIT License
5.74k stars 371 forks source link

tabsize #319

Open magicdawn opened 5 years ago

magicdawn commented 5 years ago

The tab \t is convert into 4 space, any options controling that 2space / 4space / tab output ?

Demo https://jonschlinkert.github.io/remarkable/demo/#md64=JTdCJTIyc291cmNlJTIyOiUyMi0tLSU1Q25pZDolMjB2dWV4LXV0aWwlNUNudGl0bGU6JTIwVnVleCUyMHV0aWwlNUNuLS0tJTVDbiU1Q24jIyUyMCU2MHByb3BzRmFjdG9yeSU2MCUyMC8lMjAlNjBnZXR0ZXJzRmFjdG9yeSU2MCU1Q24lNUNuJTYwJTYwJTYwanMlNUNubmV3JTIwVnVlKCU3QiU1Q24lNUN0Y29tcHV0ZWQ6JTIwJTdCJTVDbiU1Q3QlNUN0Li4ucHJvcHNGYWN0b3J5KCU3QiU1Q24lNUN0JTVDdCU1Q3RuYW1lc3BhY2U6JTIwJ2EvYicsJTVDbiU1Q3QlNUN0JTVDdGtleXM6JTIwJTVCJ2MnLCUyMCdkJyU1RCwlNUNuJTVDdCU1Q3QlN0QpLCU1Q24lNUN0JTdELCU1Q24lN0QpJTVDbiU2MCU2MCU2MCU1Q24lMjIsJTIyZGVmYXVsdHMlMjI6JTdCJTIyaHRtbCUyMjpmYWxzZSwlMjJ4aHRtbE91dCUyMjpmYWxzZSwlMjJicmVha3MlMjI6ZmFsc2UsJTIybGFuZ1ByZWZpeCUyMjolMjJsYW5ndWFnZS0lMjIsJTIybGlua2lmeSUyMjp0cnVlLCUyMmxpbmtUYXJnZXQlMjI6JTIyJTIyLCUyMnR5cG9ncmFwaGVyJTIyOnRydWUsJTIyX2hpZ2hsaWdodCUyMjp0cnVlLCUyMl9zdHJpY3QlMjI6ZmFsc2UsJTIyX3ZpZXclMjI6JTIyaHRtbCUyMiU3RCU3RA==

magicdawn commented 5 years ago

FYI I'm using facebook/Docusaurus, with highlight config

highlight: {
        // Highlight.js theme to use for syntax highlighting in code blocks.
        theme: 'default',
        hljs(hljs) {
            hljs.configure({
                tabReplace: '  ',
            })
        },
    },

the hljs.configure does not work, cause

  1. call Remarkable.prototype.render(str, env) the str includes \t
  2. after parse, the token.content is already 4 space

image