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

Show source after "Couldn't render historic post" #330

Closed
metagn opened this issue Sep 16, 2022 · 5 comments
Closed

Show source after "Couldn't render historic post" #330

metagn opened this issue Sep 16, 2022 · 5 comments

Comments

@metagn
Copy link
Contributor

metagn commented Sep 16, 2022

Right now the "Couldn't render historic post" message obscures an entire message. This is an issue because it generally happens with really long messages. To mitigate this, the raw source should be shown instead of rendering.

Also, why is a markup format giving errors?

@a-mr
Copy link
Contributor

a-mr commented Oct 1, 2022

I agree that raw source should be displayed in such a case.

Also, why is a markup format giving errors?

I think it's a not good idea to omit errors or e.g. to try removing the very notion of error from markup language as Markdown does. It results that unintended behavior is introduced all the time without users noticing.
For example if one forgot to add closing backtick ` for inline code he would have just a beginning backtick with normal non-mono-spaced text — broken formatting. It may be OK for very short posts because a user usually see his full post after pressing "Reply". But it could lead to a lot of small mistakes in large documents like Nim manual.md as users often don't proofread what they wrote.

This is where RST and Markdown are different: RST is restrictive and Markdown is extremely lax.

There are debatable edge cases e.g. this: nim-lang/Nim#19607. Here normal-looking doc comment ## 8*2 bpp (2 channels) leads to an error because of *. I have not wrapped my head around it. Again Markdown spec requires it to be parsed.

There is also related proposal nim doc/rst2html output should show parsing warnings in generated html.

@pietroppeter
Copy link

btw, until something like this is solved (I suspect that already deploying a forum with updated nim would reduce the number of non renderable posts), a workaround to know the content of a "non renderable" post is to take advantage of nimforum api, for example: https://forum.nim-lang.org/post.rst?id=57035 shows the source of the post that opens this thread: https://forum.nim-lang.org/t/8754

more example on non renderable posts can be found searching for historic post site:forum.nim-lang.org

@a-mr
Copy link
Contributor

a-mr commented Jan 9, 2023

thanks @pietroppeter , that was what I needed to know to fix such problems, but was afraid to ask :-)

@pietroppeter
Copy link

Ah nice to know that it helps! 😀 And thanks a lot for the great work you are doing for the rst/md renderer (and I guess other stuff but I have noticed that)!

a-mr added a commit to a-mr/Nim that referenced this issue 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 to nim-lang/Nim that referenced this issue 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 issue 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`
@ringabout
Copy link
Member

This is fixed by the new forum instance

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

No branches or pull requests

4 participants