本页还没有译文
本页 5 段还没译成简体中文,下面显示的是英文原文。Escape an HTML string
还没翻译译自英文(bun.com)本页 5 段都还没译
Bun.escapeHTML() escapes HTML characters in a string. It makes the following replacements.
"becomes"""&becomes"&"'becomes"'"<becomes"<">becomes">"
This function is optimized for large input. It converts non-string values to a string before escaping them.
Bun.escapeHTML("<script>alert('Hello World!')</script>");
// <script>alert('Hello World!')</script>See Utils.
AI 翻译查看英文原文