nvie / vim-rst-tables

Easily create and reformat your RST (reStructuredText) tables as you change cell content.
121 stars 36 forks source link

Support escaped "|" (pipe) chars #25

Open victorhaggqvist opened 8 years ago

victorhaggqvist commented 8 years ago

It you be nice to be able to format tables that have escaped | chars (\|) in the cells.

As it is now I get this trace when trying to do it

Error detected while processing function ReflowTable:
line    7:
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "<string>", line 292, in reflow_table
  File "<string>", line 253, in draw_table
  File "<string>", line 229, in reflow_row_contents
IndexError: list index out of range

Sample table (which don't work atm)

+--------------------+
|  foo |  bar        | 
+====================+
|  foo |  bar \| baz | 
+--------------------+
|  foo |  bar   baz  | 
+--------------------+
wdoekes commented 7 years ago

@victorhaggqvist, I've added support for inline backslashes inside tables if there is no surrounding whitespace in my python3 fork: https://github.com/ossobv/vim-rst-tables-py3/commit/45b2fed403df67c6337496c5f7837d53782081fb

That won't make | foo | bar \| baz | work, but will make | foo | bar|baz | work.