|
|
|
@@ -329,7 +329,7 @@ Function RenderPostBody(ByVal body) |
|
|
|
End If |
|
|
|
|
|
|
|
raw = CStr(body) |
|
|
|
If InStr(1, raw, "<", vbTextCompare) > 0 And InStr(1, raw, ">", vbTextCompare) > 0 Then |
|
|
|
If IsHtmlPostBody(raw) Then |
|
|
|
RenderPostBody = raw |
|
|
|
Else |
|
|
|
raw = Server.HTMLEncode(raw) |
|
|
|
@@ -340,6 +340,35 @@ Function RenderPostBody(ByVal body) |
|
|
|
End If |
|
|
|
End Function |
|
|
|
|
|
|
|
Function IsHtmlPostBody(ByVal text) |
|
|
|
Dim lowerText |
|
|
|
lowerText = LCase(CStr(text)) |
|
|
|
IsHtmlPostBody = _ |
|
|
|
(InStr(lowerText, "<p") > 0) Or _ |
|
|
|
(InStr(lowerText, "<div") > 0) Or _ |
|
|
|
(InStr(lowerText, "<br") > 0) Or _ |
|
|
|
(InStr(lowerText, "<strong") > 0) Or _ |
|
|
|
(InStr(lowerText, "<em") > 0) Or _ |
|
|
|
(InStr(lowerText, "<ul") > 0) Or _ |
|
|
|
(InStr(lowerText, "<ol") > 0) Or _ |
|
|
|
(InStr(lowerText, "<li") > 0) Or _ |
|
|
|
(InStr(lowerText, "<a ") > 0) Or _ |
|
|
|
(InStr(lowerText, "<img") > 0) Or _ |
|
|
|
(InStr(lowerText, "<blockquote") > 0) Or _ |
|
|
|
(InStr(lowerText, "<h1") > 0) Or _ |
|
|
|
(InStr(lowerText, "<h2") > 0) Or _ |
|
|
|
(InStr(lowerText, "<h3") > 0) Or _ |
|
|
|
(InStr(lowerText, "<h4") > 0) Or _ |
|
|
|
(InStr(lowerText, "<h5") > 0) Or _ |
|
|
|
(InStr(lowerText, "<h6") > 0) Or _ |
|
|
|
(InStr(lowerText, "<code") > 0) Or _ |
|
|
|
(InStr(lowerText, "<pre") > 0) |
|
|
|
End Function |
|
|
|
|
|
|
|
Function AiImageUrl(ByVal prompt) |
|
|
|
AiImageUrl = "https://gen.pollinations.ai/image/" & Server.URLEncode(Trim(CStr(prompt))) |
|
|
|
End Function |
|
|
|
|
|
|
|
'------------------------------------------------------------------------------ |
|
|
|
' Canonical application URL helpers |
|
|
|
' - Categories use numeric IDs |
|
|
|
|