@@ -26,7 +26,8 @@ import frontend/[
26
26
category, postlist, error, header, post, profile, user, karaxutils, search
27
27
]
28
28
29
- from htmlgen import tr, th, td, span, input
29
+ from htmlgen import tr, th, td, span, input, `div`, pre
30
+ from xmltree import escape
30
31
31
32
when not declared (roSandboxDisabled):
32
33
{.error : " Your Nim version is vulnerable to a CVE. Upgrade it." .}
@@ -314,7 +315,10 @@ proc selectPost(postRow: seq[string], skippedPosts: seq[int],
314
315
try :
315
316
postRow[1 ].rstToHtml ()
316
317
except EParseError :
317
- span (class= " text-error" , " Couldn't render post #$1." % postRow[0 ])
318
+ `div` (
319
+ span (class= " text-error" , " Couldn't render post #$1, raw RST below." % postRow[0 ]),
320
+ pre (xmltree.escape (postRow[1 ]))
321
+ )
318
322
319
323
return Post (
320
324
id: postRow[0 ].parseInt,
@@ -369,7 +373,10 @@ proc selectHistory(postId: int): seq[PostInfo] =
369
373
try :
370
374
row[1 ].rstToHtml ()
371
375
except EParseError :
372
- span (class= " text-error" , " Couldn't render historic post in #$1." % $ postId)
376
+ `div` (
377
+ span (class= " text-error" , " Couldn't render historic post #$1, raw RST below." % $ postId),
378
+ pre (xmltree.escape (row[1 ]))
379
+ )
373
380
))
374
381
375
382
proc selectLikes (postId: int ): seq [User ] =
0 commit comments