nim-lang / nimforum

Lightweight alternative to Discourse written in Nim
https://forum.nim-lang.org/
MIT License
760 stars 70 forks source link

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

Closed metagn closed 3 weeks ago

metagn commented 2 years ago

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 commented 1 year ago

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: https://github.com/nim-lang/Nim/issues/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 commented 1 year ago

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 commented 1 year ago

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

pietroppeter commented 1 year ago

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)!

ringabout commented 3 weeks ago

This is fixed by the new forum instance