+ 🤠关于 Memos +
+ +一个碎片化知识记录工具。
+Enjoy it and have fun~
++ Last updated on 2021/11/26 16:17:44 🎉 +
+绑定微信 OpenID
+ ++ 关注微信公众号“小谈闲事”,主动发送任意消息,即可获取 OpenID 。 +
+ +修改密码
+ ++ 🔖 + {queryId ? "编辑检索" : "创建检索"} +
+ +Daily Memos
+努力加载中...
+空空如也
+${t !== "" ? t : "
"}
{memo.createdAtStr}
+关联了 {linkMemos.length} 个 MEMO
+ {linkMemos.map((m) => { + const rawtext = parseHtmlToRawText(formatMemoContent(m.content)).replaceAll("\n", " "); + return ( +{linkedMemos.length} 个链接至此的 MEMO
+ {linkedMemos.map((m) => { + const rawtext = parseHtmlToRawText(formatMemoContent(m.content)).replaceAll("\n", " "); + return ( +正在修改中...
++ {isFetching ? "努力请求数据中..." : shownMemos.length === 0 ? "空空如也" : showMemoFilter ? "" : "所有数据加载完啦 🎉"} +
+基本信息
+ + + + +关联账号
+ + +Memo 显示相关
+ + + + +编辑器
+ +其他
++ 快速检索 + showCreateQueryDialog()}> + + + +
+QUICKLY FILTER
++ 🥰分享 Memo 图片 +
+ +{shortcutImgUrl ? "右键或长按即可保存图片 👇" : "图片生成中..."}
+常用标签
++ 输入# Tag 来创建标签吧~ +
+{props.content}
++ {username} +
+ +/g, "")
+ .replace(/<\/p>/g, "\r\n")
+ .replace(/
/g, "\r\n")
+ .replace(/ /g, " ");
+
+ // 特定语言处理
+ switch (lang) {
+ case "html":
+ convertedStr = convertedStr.replace(/</g, "<").replace(/>/g, ">");
+ }
+
+ try {
+ const resultStr = Prism.highlight(convertedStr, Prism.languages[lang], lang);
+ return `
${resultStr}`; + } catch (error) { + // do nth + } + + return `
${codeStr}`; + }); +}; + +const parseMarkedToHtml = (markedStr: string): string => { + const htmlText = parseCodeToPrism(markedStr) + .replace(DOT_LI_REG, "•") + .replace(NUM_LI_REG, "$1.") + .replace(TODO_BLOCK_REG, "⬜") + .replace(DONE_BLOCK_REG, "✅") + .replace(BOLD_TEXT_REG, "$1") + .replace(EM_TEXT_REG, "$1"); + + return htmlText; +}; + +const parseHtmlToRawText = (htmlStr: string): string => { + const tempEl = document.createElement("div"); + tempEl.className = "memo-content-text"; + tempEl.innerHTML = htmlStr; + const text = tempEl.innerText; + return text; +}; + +const parseRawTextToHtml = (rawTextStr: string): string => { + const htmlText = rawTextStr.replace(/\n/g, "