From 8412cacbce8022341a4a532ed0b0d519fb238e32 Mon Sep 17 00:00:00 2001 From: nano Date: Sun, 3 May 2026 23:11:44 +0000 Subject: [PATCH] Add HTML post editor --- core/helpers.asp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/core/helpers.asp b/core/helpers.asp index 256877b..fecbb57 100644 --- a/core/helpers.asp +++ b/core/helpers.asp @@ -321,6 +321,25 @@ Function H(s) End If End Function +Function RenderPostBody(ByVal body) + Dim raw + If IsNull(body) Or IsEmpty(body) Then + RenderPostBody = "" + Exit Function + End If + + raw = CStr(body) + If InStr(1, raw, "<", vbTextCompare) > 0 And InStr(1, raw, ">", vbTextCompare) > 0 Then + RenderPostBody = raw + Else + raw = Server.HTMLEncode(raw) + raw = Replace(raw, vbCrLf, "
") + raw = Replace(raw, vbCr, "
") + raw = Replace(raw, vbLf, "
") + RenderPostBody = raw + End If +End Function + '------------------------------------------------------------------------------ ' Canonical application URL helpers ' - Categories use numeric IDs