glasserc / rst2wp

Post to Wordpress using ReStructuredText
11 stars 10 forks source link

How to set reader/parser recognize hard tab ? #6

Closed fwolf closed 11 years ago

fwolf commented 11 years ago

I'v modify to use hard tab in my dev branch https://github.com/fwolf/rst2wp/commit/eeeccfcfe5186466e438181dec55d20049c2c866

Now set tab_width to 4 or 8 works fine. But if set tab_width to -1, which keep hard tab in generate html, and use hard tab in rst file, will cause read of categories field fail:

Post has non-existent category 'None'. Ctrl-C to cancel.   
Confirm? [yes]

My python skill is poor, only find this is about reader/parser setting, but can't find how/where to do it.

glasserc commented 11 years ago

tab_width preserves tabs only in the include directive, I think. Otherwise, they are always expanded (see docutils/statemachine.py:string2lines).

fwolf commented 11 years ago

Yes, http://docutils.sourceforge.net/docs/user/config.html#parsers has no -1 to choose, closed.