burhan-syed / troddit

A web client for Reddit with authenticated logins and a variety of browsing options
https://www.troddit.com
GNU Affero General Public License v3.0
575 stars 82 forks source link

Bug: Code blocks don't appear to be rendered properly #181

Open stevenxxiu opened 10 months ago

stevenxxiu commented 10 months ago

In the page https://www.reddit.com/r/neovim/comments/123ed7x/best_way_to_lazy_load_plugin_on_keys_that_include/, there's multiple code blocks. These don't appear to be rendered properly. They come up as a single line of bold text. For example, one has the HTML:

<code>lua
{
    "nvim-neotest/neotest",
    config = true,
    keys = {
        { "&lt;leader&gt;Tt", function() require("neotest").run.run() end },
        { "&lt;leader&gt;Tm", function() require("neotest").summary.marked() end },
        { "&lt;leader&gt;Ts", function() require("neotest").summary.toggle() end },
    },
},
</code>

I'm self-hosting, so it's possible I'm missing something. I can't test this in the official Troddit website.

burhan-syed commented 9 months ago

Noting these here for now - It appears the HTML returned in the API for this post is not surrounding these code blocks with pre tags as expected, instead leaving the raw markup with triple backticks. This breaks expected markup on Troddit as well as on old reddit and would require additional string parsing of the markdown HTML to render pre tags in place of backticks.