浏览代码

Change cleanHTML to only remove all NewLines and Tabs, but leave spaces in. This does a "good enough" job, and hopefully doesn't break Sonnix 64-bit Windows client.

KeyMasterOfGozer 5 年之前
父节点
当前提交
3f3f0e037a
共有 1 个文件被更改,包括 11 次插入10 次删除
  1. 11 10
      locations/cleanHTML.qsrc

+ 11 - 10
locations/cleanHTML.qsrc

@@ -9,17 +9,18 @@
 !	example:
 !		*pl func('cleanHTML', $HTMLString)
 
-$HTMLString = $ARGS[0]
-:cleanHTMLloop
-!$BadStr = STRFIND($HTMLString, '\>\s+\<', 0)
-!if $BadStr ! "":
-!	$HTMLString = REPLACE( $HTMLString , $BadStr , "><" )
-!	jump 'cleanHTMLloop'
-!end
+$cleanHTML['Input'] = trim($ARGS[0])
+$cleanHTML['ReturnStr'] = ""
+$cleanHTML['tab'] = "	"
+$cleanHTML['newline'] = "
+"
+!Strip out newlines and tabs, which should not be in the string
+$cleanHTML['ReturnStr'] = replace($cleanHTML['Input'],$cleanHTML['newline'],"")
+$cleanHTML['ReturnStr'] = replace($cleanHTML['ReturnStr'],$cleanHTML['tab'],"")
 
-$result = $HTMLString
+$result = $cleanHTML['ReturnStr']
 
-killvar '$HTMLString'
-killvar '$BadStr'
+killvar '$cleanHTML'
+killvar 'i'
 
 --- cleanHTML ---------------------------------