Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RST: improve simple tables #19859

Merged
merged 3 commits into from
Jun 4, 2022
Merged

RST: improve simple tables #19859

merged 3 commits into from
Jun 4, 2022

Conversation

a-mr
Copy link
Contributor

@a-mr a-mr commented Jun 2, 2022

  • Implemented joined (spanning) cells in RST simple tables (feature 9 from RST minor bugs #17340). See example below
  • require usage of only = in border of tables according to the spec (bug 18 from RST minor bugs #17340). (Usage of any other punctuation causes Github implementation to choke)
  • Check for errors — column boundary crossed, unmatched borders, etc — and throw an error
  • rework Latex rendering. see example below
=====  =====  ======
   Inputs     Output
------------  ------
  A      B    A or B 
=====  =====  ======
False  False  False
True   False  True
False  True   True
True   True   True
=====  =====  ======

Html:
image
Latex:
image

@Araq
Copy link
Member

Araq commented Jun 3, 2022

Is there a way to keep it backwards compatible so that tables can still use ------?

@a-mr
Copy link
Contributor Author

a-mr commented Jun 3, 2022

Ok, it's not too difficult, done.

@Araq Araq merged commit 4341b06 into nim-lang:devel Jun 4, 2022
@a-mr a-mr mentioned this pull request Jun 7, 2022
28 tasks
a-mr added a commit to a-mr/Nim that referenced this pull request Jun 27, 2023
Additions to RST simple tables (nim-lang#19859) made their parsing more
restrictive, which can introduce problems with of some old
nimforum posts, which have tables with sloppily aligned columns
(like this one:
nim-lang/nimforum#330 (comment)).
Also this strictness contradicts to Markdown style of not getting
in the way (ignoring errors).

So this PR proposes a new strategy of dealing with errors:
* In Markdown and legacy (old default) RstMarkdown we try to
  continue parsing, emitting only warnings
* And only in pure RST mode we throw a error

I expect that this strategy will be applied to more parts of markup code
in the future.
Araq pushed a commit that referenced this pull request Jun 28, 2023
…22165)

* Don't throw errors on RST tables in Markdown and RstMarkdown modes

Additions to RST simple tables (#19859) made their parsing more
restrictive, which can introduce problems with of some old
nimforum posts, which have tables with sloppily aligned columns
(like this one:
nim-lang/nimforum#330 (comment)).
Also this strictness contradicts to Markdown style of not getting
in the way (ignoring errors).

So this PR proposes a new strategy of dealing with errors:
* In Markdown and legacy (old default) RstMarkdown we try to
  continue parsing, emitting only warnings
* And only in pure RST mode we throw a error

I expect that this strategy will be applied to more parts of markup code
in the future.

* Don't return anything in `checkColumns`
bung87 pushed a commit to bung87/Nim that referenced this pull request Jul 29, 2023
…im-lang#22165)

* Don't throw errors on RST tables in Markdown and RstMarkdown modes

Additions to RST simple tables (nim-lang#19859) made their parsing more
restrictive, which can introduce problems with of some old
nimforum posts, which have tables with sloppily aligned columns
(like this one:
nim-lang/nimforum#330 (comment)).
Also this strictness contradicts to Markdown style of not getting
in the way (ignoring errors).

So this PR proposes a new strategy of dealing with errors:
* In Markdown and legacy (old default) RstMarkdown we try to
  continue parsing, emitting only warnings
* And only in pure RST mode we throw a error

I expect that this strategy will be applied to more parts of markup code
in the future.

* Don't return anything in `checkColumns`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants