Skip to content

Releases: BAIYUMIAN/obsidian-custom-syntax

1.2.0

Choose a tag to compare

@github-actions github-actions released this 03 Sep 07:25

v1.2.0

Changed

  • Sidebar navbars (top + bottom) now follow Obsidian's native surface colour. They blend into the sidebar instead of reading as a separate highlighted bar — no more distinct "fixed" block, just normal background with a thin separator
  • CSS declarations editor height adapts to the page. Its max-height is now clamp(160px, 40vh, 320px), so the editor page stays compact while the navbar/footer stay pinned around it
  • Built-in documentation modal reworked. The navbar is now a centered title with an external-link icon (opens the README on GitHub), and a close icon sits on the right (Obsidian's native modal close is hidden to avoid a duplicate)

Fixed

  • Sidebar "Settings" icon now opens the plugin's settings page. openPluginSettings() now waits for the settings modal to open before navigating to the tab — previously openTabById ran before the modal was ready and silently did nothing

Changed

  • Version bumped to 1.2.0 (manifest.json, package.json, versions.json)

变更

  • 侧边栏导航栏(顶部 + 底部)改为跟随 Obsidian 原生表面色。 它们融入侧边栏背景,不再像一块独立的高亮条——只保留正常的背景与一条细分隔线,不再凸显"固定栏"
  • CSS 声明编辑器高度随页面自适应。 最大高度改为 clamp(160px, 40vh, 320px),编辑页更紧凑,顶部/底部导航栏稳定固定在四周
  • 内置说明文档弹窗重排。 导航栏改为居中标题 + 外链图标(点击在浏览器打开 GitHub README),右侧为关闭图标(隐藏 Obsidian 原生关闭按钮以避免重复)

修复

  • 侧边栏"设置"图标现在能正常打开插件设置页。 openPluginSettings() 会先等待设置弹窗打开再跳转到本插件标签页——此前 openTabById 在弹窗就绪前执行,导致静默失败

变更

  • 版本号升至 1.2.0(manifest.json、package.json、versions.json 三处同步)

1.1.4

Choose a tag to compare

@github-actions github-actions released this 02 Sep 21:34

v1.1.4

Fixed

  • CSS declarations editor now highlights reliably. Replaced CodeMirror's built-in HighlightStyle (which injects auto-generated classes and a <style> that Obsidian modals do not reliably apply, so nothing was coloured) with our own namespaced token classes (.cs-tok-*) coloured from this plugin's styles.css. Every token is now coloured and follows the active light/dark theme — property names, numbers, units, values/keywords, functions, CSS variables such as --interactive-accent, strings, and punctuation
  • Removed a stray zero-width space (U+200B) in src/cssEditor.ts that triggered the "Irregular whitespace not allowed" review warning

Changed

  • Version bumped to 1.1.4 (manifest.json, package.json, versions.json)

修复

  • CSS 声明编辑器现在稳定高亮。 弃用 CodeMirror 自带的 HighlightStyle(它注入的自动类名和 <style> 在 Obsidian 弹窗里不可靠地生效,导致完全不高亮),改为使用本插件自己的具名 token 类(.cs-tok-*)并写在 styles.css 中上色。现在每个 token 都会上色,且跟随当前浅色/深色主题——属性名、数字、单位、值/关键字、函数、像 --interactive-accent 这样的 CSS 变量、字符串、标点符号
  • 移除一个零宽空格(U+200B):位于 src/cssEditor.ts,正是触发「Irregular whitespace not allowed」审查警告的元凶

变更

  • 版本号升至 1.1.4(manifest.json、package.json、versions.json 三处同步)

1.0.4

Choose a tag to compare

@github-actions github-actions released this 02 Sep 19:00

v1.0.4

Fixed

  • Resolved all community plugin review findings: error banner in the rule editor now toggles via a CSS class instead of inline style.display assignments
  • All promises are now properly awaited or explicitly ignored — no more floating promises in event handlers
  • Deleting every rule no longer restores the default rule after restarting Obsidian

Improved

  • Uses Obsidian's native DOM helpers (createSpan(), createFragment()) everywhere instead of createEl("span") / document.createDocumentFragment()
  • Removed dead code (bumpSettingsVersion), unused imports, a redundant type assertion, and a duplicate esbuild key in package.json
  • Reproducible builds: all dev dependencies pinned to exact versions, and CI upgraded from Node 18 (EOL) to Node 22
  • Version numbers synchronized across manifest.json, package.json, and versions.json (adds the missing 1.0.3 entry)

修复

  • 解决社区插件审查提出的全部问题:规则编辑器中的错误提示改为 CSS 类切换,不再直接设置 style.display
  • 所有 Promise 均被正确等待或显式忽略,事件处理中不再有悬空 Promise
  • 删除全部规则后,重启 Obsidian 不再恢复默认规则

改进

  • 全面改用 Obsidian 原生 DOM 辅助函数(createSpan()、createFragment()),替代 createEl("span") / document.createDocumentFragment()
  • 清理死代码(bumpSettingsVersion)、未使用的导入、多余的类型断言,以及 package.json 中重复的 esbuild 键
  • 构建可复现:所有开发依赖锁定为精确版本,CI 从 Node 18(已停止支持)升级到 Node 22
  • 同步 manifest.json、package.json、versions.json 中的版本号(补充缺失的 1.0.3 条目)

1.0.3

Choose a tag to compare

@github-actions github-actions released this 02 Sep 18:08

v1.0.3

Fixed

  • Removed dynamic CSS injection, using setCssStyles for safe style application (passes community review)
  • Replaced window.confirm with mobile-safe custom confirm modal

Improved

  • Fixed document.createElement → createEl
  • Removed deprecated builtin-modules dependency

修复

  • 移除动态 CSS 注入,改用 setCssStyles 安全设置样式,通过社区审查
  • 删除规则确认改为移动端安全的自绘确认框

改进

  • 修复 document.createElement → createEl
  • 移除废弃的 builtin-modules 依赖

1.0.2

Choose a tag to compare

@github-actions github-actions released this 02 Sep 17:37

v1.0.2

Improvements

  • Modal buttons aligned bottom-right (cancel, then confirm/create)
  • Toggle is now keyboard-accessible and screen-reader friendly
  • Release workflow upgraded to actions/checkout@v4 and setup-node@v4

Added

  • Chinese README (README.zh-CN.md)

改进

  • 弹窗按钮改为右下角统一排列(取消在前,确认/创建在后)
  • 开关增加无障碍支持(键盘可操作、屏幕阅读器可读)
  • 发布工作流升级到 actions/checkout@v4、setup-node@v4

新增

  • 中文说明文档 README.zh-CN.md

1.0.1

Choose a tag to compare

@github-actions github-actions released this 02 Sep 17:22

v1.0.1

English

Fixed

  • Replaced the delete confirmation with a mobile-safe custom dialog, so deleting a rule now works on iOS / Android (previously window.confirm was unsupported on mobile).

中文

修复

  • 删除规则的确认框改为移动端安全的自绘确认框,兼容 iOS / Android(此前使用 window.confirm 在移动端不生效,导致删除按钮无响应)。

1.0.0

Choose a tag to compare

@github-actions github-actions released this 02 Sep 17:06

Custom Syntax v1.0.0

Define custom inline syntax delimiters and render them with your own CSS — with native, real-time preview, just like built-in Markdown.

Wrap text with a delimiter you define (e.g. ++text++) and it renders instantly with the CSS you specify (a rounded box by default).

Features

  • Define any inline delimiter and map it to arbitrary CSS
  • Native real-time preview in Live Preview and Source mode
  • Markers hide automatically and reappear when the cursor is inside the match
  • Reading view rendering, skipping code blocks, inline code, links, and math
  • Conflict detection against built-in Markdown syntax and your other custom rules
  • Bilingual UI (English / 中文) with "follow system" language detection

Quick start

  1. Open Settings → Custom Syntax → Add rule
  2. Enter a name, a delimiter (e.g. ++), and CSS
  3. Type ++text++ in a note

Example CSS

  • Rounded box: border: 1px solid var(--interactive-accent); border-radius: 6px; padding: 1px 5px;
  • Highlight: background-color: var(--text-highlight-bg);
  • Red text: color: red; font-weight: bold;

Feedback

Repository: https://github.com/BAIYUMIAN/obsidian-custom-syntax