daily: 2021-09-26
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
// 为了解决svg text不渲染连续空格,对html转义并替换空格为
|
||||
export default function escapeHtml(text) {
|
||||
const span = document.createElement("span");
|
||||
span.appendChild(document.createTextNode(text));
|
||||
return span.innerHTML.replace(/\s/g, " ");
|
||||
}
|
||||
Reference in New Issue
Block a user