diff --git a/web-next/.env.development b/web-next/.env.development new file mode 100644 index 00000000..2bf124d9 --- /dev/null +++ b/web-next/.env.development @@ -0,0 +1 @@ +VITE_API_BASE_URL=/api/v1 diff --git a/web-next/.env.production b/web-next/.env.production new file mode 100644 index 00000000..2bf124d9 --- /dev/null +++ b/web-next/.env.production @@ -0,0 +1 @@ +VITE_API_BASE_URL=/api/v1 diff --git a/web-next/.gitignore b/web-next/.gitignore new file mode 100644 index 00000000..804bd4a4 --- /dev/null +++ b/web-next/.gitignore @@ -0,0 +1,3 @@ +node_modules +dist +*.local diff --git a/web-next/index.html b/web-next/index.html new file mode 100644 index 00000000..48fa2319 --- /dev/null +++ b/web-next/index.html @@ -0,0 +1,12 @@ + + +
+ + ++ {{ route.meta.subtitle }} +
+${codes[Number(i)]!}`)
+}
+
+/** 块级行判据(段落收集的截断条件):代码围栏 / 标题 / 列表。 */
+const BLOCK_START = /^(#{1,4}\s|\s*[-*]\s|\s*\d+(?:\.\s+|、\s*)|```)/
+/** 有序列表行:点号后须空格(英文习惯),顿号后空格可选(中文习惯)。 */
+const OL_LINE = /^\s*\d+(?:\.\s+|、\s*)/
+
+/** Markdown → HTML(输入不可信,输出已全量转义;v-html 挂载)。 */
+export function renderMarkdown(src: string): string {
+ const lines = escapeHtml(src.replace(/\r\n/g, '\n')).split('\n')
+ const out: string[] = []
+ let i = 0
+ while (i < lines.length) {
+ const line = lines[i]!
+ // 围栏代码块:内容保持原样(不再做行内格式化)
+ if (line.trim().startsWith('```')) {
+ const buf: string[] = []
+ i++
+ while (i < lines.length && !lines[i]!.trim().startsWith('```')) buf.push(lines[i++]!)
+ i++ // 跳过闭合围栏(缺闭合则吞到结尾)
+ out.push(`${buf.join('\n')}`)
+ continue
+ }
+ // 标题 # ~ ####
+ const h = /^(#{1,4})\s+(.*)$/.exec(line)
+ if (h) {
+ const lv = h[1]!.length
+ out.push(`${buf.map(inline).join('
')}
该页面建设中,即将在新版管理台与您见面。
+页面不存在或已被移除。
+汇网综合业务支撑平台
+登录管理台
+