vim-easy-align icon indicating copy to clipboard operation
vim-easy-align copied to clipboard

Align error with markdown table syntax and escape character

Open yuesong-feng opened this issue 2 years ago • 1 comments

With the following table in markdown:

## 窗口与跳转

| 快捷键| 原指令          | 描述
| -----| -----   | ----
|   | CTRL-O或CTRL-I | 返回光标上一个/下一个所在位置
|;n| :NERDTreeToggle  | 打开目录
| | CTRL-W \|          | 将当前窗口的宽度设置为尽可能最宽

after easy-align, I get:

## 窗口与跳转

| 快捷键 | 原指令          | 描述
| -----  | -----           | ----
|        | CTRL-O或CTRL-I  | 返回光标上一个/下一个所在位置
| ;n     | :NERDTreeToggle | 打开目录
| ;m     | :TagbarToggle   | 打开tag列表
|        | CTRL-W \        |  | 将当前窗口的宽度设置为尽可能最宽

obviously, the last line is wrong. \| means a single | to show in the table, while the \ is the escape character. The following | is the table syntax. The correct result should be:

## 窗口与跳转

| 快捷键 | 原指令          | 描述
| -----  | -----           | ----
|        | CTRL-O或CTRL-I  | 返回光标上一个/下一个所在位置
| ;n     | :NERDTreeToggle | 打开目录
| ;m     | :TagbarToggle   | 打开tag列表
|        | CTRL-W \|       | 将当前窗口的宽度设置为尽可能最宽

yuesong-feng avatar Jan 12 '23 04:01 yuesong-feng

Did you figure a solution to this?

Edit #59 seems to have the solution to this.

MathieuDR avatar Sep 16 '23 23:09 MathieuDR