我正在通过 Socket.io 加载数据,然后将其包装在一些 HTML 中,然后使用 DOMParser 对其进行解析,将其添加到我的容器中,但<br>
只是被忽略了。
这是容器:
虽然这是源代码
<div webm-query="Lina.httpd.Access" webm-display="<span>%v</span><br />">
<span>212.142.132.240: GET / HTTP/1.1 -> 200</span><br></br>
<span>212.142.132.240: GET / HTTP/1.1 -> 200</span><br></br>
<span>212.142.132.240: GET / HTTP/1.1 -> 200</span><br></br>
<span>212.142.132.240: GET / HTTP/1.1 -> 200</span><br></br>
<span>212.142.132.240: GET / HTTP/1.1 -> 200</span><br></br>
<span>212.142.132.240: GET / HTTP/1.1 -> 200</span><br></br>
<span>212.142.132.240: GET / HTTP/1.1 -> 200</span><br></br>
<span>212.142.132.240: GET / HTTP/1.1 -> 200</span><br></br>
<span>212.142.132.240: GET / HTTP/1.1 -> 200</span><br></br>
<span>212.142.132.240: GET / HTTP/1.1 -> 200</span><br></br>
<span>212.142.132.240: GET / HTTP/1.1 -> 200</span><br></br>
<span>212.142.132.240: GET / HTTP/1.1 -> 200</span><br></br>
</div>
通过生成
var data = ((Properties.Modifier && webm.Modifier[Properties.Modifier]) ?
webm.Modifier[Properties.Modifier](Data) : Data);
var html = (Properties.Display) ? "<div>"+replaceAll("'", "\"", replaceAll("%k", Query, replaceAll("%v",data, roperties.Display)))+"</div>" :data;
return htmlString = (Properties.Display) ? new DOMParser().parseFromString(html, "text/xml") : data;