mgaitan / sublime-rst-completion

Restructured Text snippets and code completion hotkeys for Sublime Text 2 and 3
BSD 3-Clause "New" or "Revised" License
251 stars 52 forks source link

Magic Table generate 'Malformed Table' error with CJK characters. #83

Open haje01 opened 9 years ago

haje01 commented 9 years ago

Magic Table feature has a flaw with CJK(Chinese, Japanese, Korean) characters. Following text:

aa  b.b.
가  나

will be converted into:

+----+----+
| aa | bb |
+====+====+
| 가  | 나  |
+----+----+

which generates 'Malformed Table' error with Sphinx. Right conversion will be:

+----+----+
| aa | bb |
+====+====+
| 가 | 나 |
+----+----+

I guess you should count a CJK character takes two-spaces. Vim's RST table plugin also has same issue. So, there are specific plugin to solve this:

https://github.com/vim-scripts/RST-Tables-CJK

Following python package might be handy for you:

https://pypi.python.org/pypi/wcwidth/

I hope you can fix it without much trouble. Thank you.

mgaitan commented 9 years ago

Thanks Kim, I'll dive into it shortly

On Thu, Jun 25, 2015 at 6:43 AM, Kim Jeong Ju notifications@github.com wrote:

Magic Table feature has a flaw with CJK(Chinese, Japanese, Korean) characters. Following text:

aa b.b. 가 나

will be converted into:

+----+----+ | aa | bb | +====+====+ | 가 | 나 | +----+----+

which generates 'Malformed Table' error with Sphinx. Right conversion will be:

+----+----+ | aa | bb | +====+====+ | 가 | 나 | +----+----+

I guess you should count a CJK character takes two-spaces. Vim's RST table plugin also has same issue. So, there are specific plugin to solve this:

https://github.com/vim-scripts/RST-Tables-CJK

I hope you can fix it without much trouble. Thank you.

— Reply to this email directly or view it on GitHub https://github.com/mgaitan/sublime-rst-completion/issues/83.

mgaitan.github.io textosypretextos.com.ar