diff --git a/docs/changelog.html b/docs/changelog.html index 53fc0cf..5f82bc2 100644 --- a/docs/changelog.html +++ b/docs/changelog.html @@ -1,5 +1,5 @@ - + @@ -16,10 +16,10 @@
-

VoidRaft 更新日志

+

VoidRaft Changelog

- +
diff --git a/docs/css/changelog.css b/docs/css/changelog.css index 5620b03..b29cc50 100644 --- a/docs/css/changelog.css +++ b/docs/css/changelog.css @@ -179,7 +179,27 @@ .markdown-content ul, .markdown-content ol { padding-left: 20px; - margin-bottom: 15px; + margin: 10px 0; +} + +.markdown-content li { + margin-bottom: 8px; +} + +.markdown-content li:last-child { + margin-bottom: 0; +} + +.markdown-content hr { + border: none; + border-top: 2px dashed var(--border-color); + margin: 20px 0; +} + +.markdown-content br { + display: block; + content: ""; + margin-top: 10px; } .markdown-content code { @@ -232,6 +252,21 @@ text-decoration: underline; } +/* Markdown内容样式增强 */ +.markdown-content blockquote { + border-left: 4px solid var(--primary-color); + padding: 10px 15px; + margin: 15px 0; + background-color: rgba(var(--light-bg-rgb), 0.5); + border-radius: 0 4px 4px 0; +} + +.markdown-content ul, +.markdown-content ol { + padding-left: 20px; + margin: 10px 0; +} + /* 移动设备响应式优化 */ @media (max-width: 768px) { .release-header { diff --git a/docs/css/ibm-plex-mono-font.css b/docs/css/ibm-plex-mono-font.css new file mode 100644 index 0000000..4292894 --- /dev/null +++ b/docs/css/ibm-plex-mono-font.css @@ -0,0 +1,45 @@ +/* cyrillic-ext */ +@font-face { + font-family: 'IBM Plex Mono'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(../font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1iIq129k.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'IBM Plex Mono'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(../font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1isq129k.woff2) format('woff2'); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* vietnamese */ +@font-face { + font-family: 'IBM Plex Mono'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(../font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1iAq129k.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'IBM Plex Mono'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(../font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1iEq129k.woff2) format('woff2'); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'IBM Plex Mono'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(../font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1i8q1w.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} \ No newline at end of file diff --git a/docs/css/space-mono-font.css b/docs/css/space-mono-font.css new file mode 100644 index 0000000..75288f5 --- /dev/null +++ b/docs/css/space-mono-font.css @@ -0,0 +1,27 @@ +/* vietnamese */ +@font-face { + font-family: 'Space Mono'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(../font/space-mono/i7dPIFZifjKcF5UAWdDRYE58RWq7.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Space Mono'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(../font/space-mono/i7dPIFZifjKcF5UAWdDRYE98RWq7.woff2) format('woff2'); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Space Mono'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(../font/space-mono/i7dPIFZifjKcF5UAWdDRYEF8RQ.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} \ No newline at end of file diff --git a/docs/css/styles.css b/docs/css/styles.css index 18d2914..b664393 100644 --- a/docs/css/styles.css +++ b/docs/css/styles.css @@ -1,5 +1,5 @@ -@import url('https://fonts.googleapis.com/css2?family=Space+Mono&display=swap'); -@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&display=swap'); +@import url('./space-mono-font.css'); +@import url('./ibm-plex-mono-font.css'); /* 浅色主题 */ :root { diff --git a/docs/font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1i8q1w.woff2 b/docs/font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1i8q1w.woff2 new file mode 100644 index 0000000..a6c77d6 Binary files /dev/null and b/docs/font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1i8q1w.woff2 differ diff --git a/docs/font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1iAq129k.woff2 b/docs/font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1iAq129k.woff2 new file mode 100644 index 0000000..1bb5b4d Binary files /dev/null and b/docs/font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1iAq129k.woff2 differ diff --git a/docs/font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1iEq129k.woff2 b/docs/font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1iEq129k.woff2 new file mode 100644 index 0000000..53fb6e5 Binary files /dev/null and b/docs/font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1iEq129k.woff2 differ diff --git a/docs/font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1iIq129k.woff2 b/docs/font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1iIq129k.woff2 new file mode 100644 index 0000000..8000213 Binary files /dev/null and b/docs/font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1iIq129k.woff2 differ diff --git a/docs/font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1isq129k.woff2 b/docs/font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1isq129k.woff2 new file mode 100644 index 0000000..ab7e904 Binary files /dev/null and b/docs/font/ibm-plex-mono/-F63fjptAgt5VM-kVkqdyU8n1isq129k.woff2 differ diff --git a/docs/font/space-mono/i7dPIFZifjKcF5UAWdDRYE58RWq7.woff2 b/docs/font/space-mono/i7dPIFZifjKcF5UAWdDRYE58RWq7.woff2 new file mode 100644 index 0000000..f4c014c Binary files /dev/null and b/docs/font/space-mono/i7dPIFZifjKcF5UAWdDRYE58RWq7.woff2 differ diff --git a/docs/font/space-mono/i7dPIFZifjKcF5UAWdDRYE98RWq7.woff2 b/docs/font/space-mono/i7dPIFZifjKcF5UAWdDRYE98RWq7.woff2 new file mode 100644 index 0000000..171ca1a Binary files /dev/null and b/docs/font/space-mono/i7dPIFZifjKcF5UAWdDRYE98RWq7.woff2 differ diff --git a/docs/font/space-mono/i7dPIFZifjKcF5UAWdDRYEF8RQ.woff2 b/docs/font/space-mono/i7dPIFZifjKcF5UAWdDRYEF8RQ.woff2 new file mode 100644 index 0000000..2752f60 Binary files /dev/null and b/docs/font/space-mono/i7dPIFZifjKcF5UAWdDRYEF8RQ.woff2 differ diff --git a/docs/index.html b/docs/index.html index 4bc9c7a..8c4d663 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,8 +6,6 @@ VoidRaft - An elegant text snippet recording tool designed for developers. - - @@ -18,7 +16,7 @@

VoidRaft

VoidRaft

-

优雅的文本片段记录工具

+

An elegant text snippet recording tool

-

专为开发者打造,随时随地记录、整理和管理各种文本片段。

+

Designed for developers to record, organize, and manage various text snippets anytime, anywhere.

- 下载 + Download - 源代码 + Source Code - 更新日志 + Changelog
-

核心特性

+

Core Features

-

开发者友好

-

多语言代码块支持,为30+种编程语言提供语法高亮

+

Developer-Friendly

+

Multi-language code blocks with syntax highlighting for 30+ programming languages

-

代码格式化

-

内置Prettier支持,一键美化代码

+

Code Formatting

+

Built-in Prettier support for one-click code beautification

-

自定义主题

-

深色/浅色主题,支持完全自定义

+

Custom Themes

+

Dark/Light themes with full customization options

-

多窗口支持

-

同时编辑多个文档

+

Multi-Window

+

Edit multiple documents simultaneously

-

块状编辑

-

将内容分割为独立的代码块,每个块可设置不同语言

+

Block Editing

+

Split content into independent code blocks with different language settings

-

丰富扩展

-

彩虹括号、VSCode风格搜索、颜色选择器、翻译工具等多种扩展

+

Extensions

+

Rainbow brackets, VSCode-style search, color picker, translation tool, and more

-

预览

+

Preview

@@ -157,44 +155,44 @@
-

技术栈

+

Technical Stack

diff --git a/docs/js/changelog.js b/docs/js/changelog.js index 46081b7..3cb728a 100644 --- a/docs/js/changelog.js +++ b/docs/js/changelog.js @@ -433,43 +433,101 @@ document.addEventListener('DOMContentLoaded', () => { function parseMarkdown(markdown) { if (!markdown) return ''; - // Links - [text](url) + // 预处理:保留原始换行符,用特殊标记替换 + const preservedLineBreaks = '___LINE_BREAK___'; + markdown = markdown.replace(/\n/g, preservedLineBreaks); + + // 引用块 - > text + markdown = markdown.replace(/>\s*(.*?)(?=>|$)/g, '
$1
'); + markdown = markdown.replace(/>\s*(.*?)(?=>|$)/g, '
$1
'); + + // 链接 - [text](url) markdown = markdown.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '$1'); - // Headings - # Heading - markdown = markdown.replace(/^### (.*$)/gm, '

$1

'); - markdown = markdown.replace(/^## (.*$)/gm, '

$1

'); - markdown = markdown.replace(/^# (.*$)/gm, '

$1

'); + // 标题 - # Heading + markdown = markdown.replace(/^### (.*?)(?=___LINE_BREAK___|$)/gm, '

$1

'); + markdown = markdown.replace(/^## (.*?)(?=___LINE_BREAK___|$)/gm, '

$1

'); + markdown = markdown.replace(/^# (.*?)(?=___LINE_BREAK___|$)/gm, '

$1

'); - // Bold - **text** + // 粗体 - **text** markdown = markdown.replace(/\*\*(.*?)\*\*/g, '$1'); - // Italic - *text* + // 斜体 - *text* markdown = markdown.replace(/\*(.*?)\*/g, '$1'); - // Code blocks - ```code``` + // 代码块 - ```code``` markdown = markdown.replace(/```([\s\S]*?)```/g, '
$1
'); - // Inline code - `code` + // 行内代码 - `code` markdown = markdown.replace(/`([^`]+)`/g, '$1'); - // Lists - * item - markdown = markdown.replace(/^\* (.*$)/gm, ''); + // 处理列表项 + // 先将每个列表项转换为HTML + markdown = markdown.replace(/- (.*?)(?=___LINE_BREAK___- |___LINE_BREAK___$|$)/g, '
  • $1
  • '); + markdown = markdown.replace(/\* (.*?)(?=___LINE_BREAK___\* |___LINE_BREAK___$|$)/g, '
  • $1
  • '); + markdown = markdown.replace(/\d+\. (.*?)(?=___LINE_BREAK___\d+\. |___LINE_BREAK___$|$)/g, '
  • $1
  • '); - // Lists - 1. item - markdown = markdown.replace(/^\d+\. (.*$)/gm, '
    1. $1
    '); + // 然后将连续的列表项包装在ul或ol中 + const listItemRegex = /
  • .*?<\/li>/g; + const listItems = markdown.match(listItemRegex) || []; - // Merge adjacent list items - markdown = markdown.replace(/<\/ul>\s*