mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 14:25:51 +00:00
feat(remote-control): 优化 Web 展示、状态同步与桥接控制流程 (#288)
Co-authored-by: chengzifeng <chengzifeng@meituan.com>
This commit is contained in:
@@ -2,11 +2,23 @@
|
||||
* Remote Control — Shared Utilities
|
||||
*/
|
||||
|
||||
const HTML_ESCAPE_MAP = {
|
||||
"&": "&",
|
||||
"<": "<",
|
||||
">": ">",
|
||||
'"': """,
|
||||
"'": "'",
|
||||
};
|
||||
|
||||
export function esc(str) {
|
||||
if (!str) return "";
|
||||
const div = document.createElement("div");
|
||||
div.textContent = String(str);
|
||||
return div.innerHTML;
|
||||
const value = String(str);
|
||||
if (typeof document !== "undefined" && typeof document.createElement === "function") {
|
||||
const div = document.createElement("div");
|
||||
div.textContent = value;
|
||||
return div.innerHTML;
|
||||
}
|
||||
return value.replace(/[&<>"']/g, (char) => HTML_ESCAPE_MAP[char]);
|
||||
}
|
||||
|
||||
export function formatTime(ts) {
|
||||
|
||||
Reference in New Issue
Block a user