MarkdownTableFormatter icon indicating copy to clipboard operation
MarkdownTableFormatter copied to clipboard

Can it support UTF-8 character?

Open g8up opened this issue 9 years ago • 5 comments

like

| 业务方向      | 线人         |
|:----------|:-----------|
| 运营后台 - 销售 | 雪、鹏、丽 |
| 智能商业部     | 瑞         |

g8up avatar Dec 27 '16 13:12 g8up

I might have found a way to do this, I'll give a try soon

bitwiser73 avatar Jan 17 '17 23:01 bitwiser73

I tried to add support for asian characters on MTF. I have a working test which render well inside gnome-terminal but I'm still having issue with ST3. As explained in this post, some monospace characters aren't well supported yet by OSes and browsers... I will open an issue on sublimehq's github.

It's first the time I'm working with asian character set, may be you know some way to make it work ? Basically two ascii characters should have the width of one asian character (fullwidth).

Someone having the same king of issue with ST3 : https://forum.sublimetext.com/t/some-monospace-characters-are-not-rendering-as-proper-monospace/23323

st3_monospace_issue_gnome_term

st3_monospace_issue

bitwiser73 avatar Feb 05 '17 14:02 bitwiser73

You can find mtf.py in branch 4_cjk_font which is a standalone cli script (no need of sublime) to format md table. It should support asian characters aswell.

simple_markdown/mtf.py -h
usage: mtf.py [-h] [-i] [-m MARGIN] [-p PADDING] [-j {left,center,right}] [-c]
              [-e ENCODING]
              input_file

Format markdown tables

positional arguments:
  input_file            input file to format

optional arguments:
  -h, --help            show this help message and exit
  -i, --in-place        edit files in place
  -m MARGIN, --margin MARGIN
                        set margin
  -p PADDING, --padding PADDING
                        set padding
  -j {left,center,right}, --justify {left,center,right}
                        set default justification
  -c, --convert-cjk     Convert all characters to CJK if any is found
  -e ENCODING, --encoding ENCODING
                        set encoding

bitwiser73 avatar Jul 08 '17 17:07 bitwiser73

I have an idea to solve this problem in sublime text3. https://github.com/zh-five/MarkdownFormat

zh-five avatar Jan 09 '18 14:01 zh-five

Thank you @zh-five , did you try the version from the version from https://github.com/bitwiser73/MarkdownTableFormatter/tree/4_cjk_font ? I am surprised ST3 seems to have better font rendering on Mac OS.

bitwiser73 avatar Jan 20 '19 18:01 bitwiser73