后台文章发布,发表格后表格显示正常,但显示页面文章标题和表格距离很大,如果发的是纯文字就没有距离,如果发表格就距离很大,察看源文件时,每一个<td>后总生成一个<br>,我的输出叶面有个html过滤,谁能帮我改改,以解决这个问题,谢谢!
'==================================================
' 函数名:inhtml(strhtml,en),outhtml(strhtml),delhtml(strhtml)
' 作 用:html过滤
' 参 数:strhtml
'==================================================
dim character_A
character_A = "|<|>|chr(32)|chr(9)|chr(34)|chr(39)|chr(13)|chr(10)&chr(10)|| "
character_A = split(character_A,"|")
dim character_B
character_B = "|<|>| | |"|'|&nbsp;|</p><p>|<br />| "
character_B = split(character_B,"|")
dim character_C
character_C = "|<|>| | |"|'| |</p><p>|<br />| "
character_C = split(character_C,"|")
dim character_cn
character_cn = "|‘|’|“|”"
character_cn = character_cn & "|,|。|!|?|:|;|、"
character_cn = character_cn & "|(|)|【|】|『|』|《|》"
character_cn = character_cn & "|+|-|×|÷"
character_cn = character_cn & "|~|◎|#|¥|%|……|※|——|§"
character_cn = split(character_cn,"|")
dim character_en
character_en = "|'|'|"|"""
character_en = character_en & "|,|.|!|?|:|;|,"
character_en = character_en & "|(|)|[|]|{|}|<|> "
character_en = character_en & "|+|-|*|\"
character_en = character_en & "|~|@|#|$|%|^|&|-|\"
character_en = split(character_en,"|")
'=======
''
'inhtml(strhtml,0)
'
function inhtml(strhtml,en)
if not isnull(strhtml) then
strhtml = trim(strhtml)
for i = 1 to UBound(character_A)
strhtml = replace(strhtml, character_A(i), character_B(i))
next
if int(en)=1 then '转换成英文字符
for i = 1 to UBound(character_cn)
strhtml = replace(strhtml, character_cn(i), character_en(i))
next
end if
strhtml = replace(strhtml, "<p align="left">", "<p>")
inhtml = strhtml
end if
end function
function outhtml(strhtml)
if not isnull(strhtml) then
strhtml = trim(strhtml)
for i = 1 to UBound(character_B)
strhtml = replace(strhtml, character_B(i), character_C(i))
next
outhtml = strhtml
end if
end function
function delhtml(strhtml)
dim objregexp, stroutput
set objregexp = new regexp
objregexp.ignorecase = true
objregexp.global = true
objregexp.pattern = "(<[a-za-z].*?>)|(<[\/][a-za-z].*?>)"
stroutput = objregexp.replace(strhtml, "")
stroutput = replace(stroutput, "<", "<")
stroutput = replace(stroutput, ">", ">")
delhtml = stroutput
set objregexp = nothing
end function