소스 검색

Swap editor for Quill and add AI image insertion

master
nano 5 일 전
부모
커밋
e45a91c6a5
1개의 변경된 파일30개의 추가작업 그리고 1개의 파일을 삭제
  1. +30
    -1
      core/helpers.asp

+ 30
- 1
core/helpers.asp 파일 보기

@@ -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


불러오는 중...
취소
저장

Powered by TurnKey Linux.