Skip to content

Releases: Yaozhuwa/easy-typing-obsidian

V5.5.0 自定义规则支持正则表达式匹配及多光标跳转,多语言支持

27 Jul 17:10
Compare
Choose a tag to compare
  • V5.5.0 2024-07-28 自定义规则支持正则表达式匹配及多光标跳转,多语言支持
    • 重大更新(破坏性更新)
      • 自定义规则支持多光标跳转(参考了 Latex-Suite 代码),结合v5.4.0版本的更新,目前的自定义删除/转化规则支持正则表达式匹配及多光标跳转
      • 转化后字符串
        • 多光标用 $n 表示,n 为从 0 开始的整数,也可以使用 ${n: 文本} 来表示文本被选中,Tab 键可以跳转到下一个光标
        • 自定义规则的正则匹配语法: r/正则表达式1/|r/正则表达式2/,这是光标左右都是正则表达式匹配的情况。
          • 也可以只有一边是正则表达式匹配,另一边是之前的匹配如: !|r/\[\[.+?\]\]/,可以匹配在 wiki 链接前输入全角叹号 的情况。
        • !! 不同于 V5.4.0 版本,现在不再用 $n 来引用正则表达式捕获的匹配组的内容,而是使用 [[n]] 来引用
          • [[n]],匹配成功的第 n 组内容,n 是从 0 开始的自然数。
          • 对于 正则表达式 2 匹配的第 m 组内容,设置为 [[m+n]],n 为第一个正则表达式匹配的组的数量。
            例子:自定义转换规则: 匹配 r/(?<=^|\n)([\w-]+)-call/|, 转换成 > [![[0]]] $0\n> $1,即可实现在行首输入 note-call,即可转换成
          > [!note] $0
          > $1
          
          其中, $0, $1 表示不同的两个光标,可以通过 Tab 键从 $0 跳转到 $1
          multi-cursor
    • 其他更新
      • 增加多语言支持,目前支持了简体中文\繁体中文\英文\俄文, #234, Thanks to niazlv
      • 修复自定义删除/转换规则 中的转义符无法转义 #240
      • 优化链接根据别名智能空格的效果 #233
      • 自定义正则表达式区域支持注释行, 以 // 开头的行被视为注释 #173

V5.5.0 2024-07-28 Custom Rule Support for Regular Expression Matching and Multi-Cursor Navigation, Multi-Language Support

Major Update (Breaking Changes)

  • Custom Multi-Cursor Navigation: Inspired by Latex-Suite code, custom rules now support multi-cursor navigation. Building on the update from version 5.4.0, the current custom delete/transform rules support regular expression matching and multi-cursor navigation.
  • Transformed String Details:
    • Multiple cursors are denoted by $n, where n is an integer starting from 0. The format ${n: text} can also be used to indicate that the text is selected, with the Tab key navigating to the next cursor.
    • Custom rule regular expression matching syntax: r/Regular Expression 1/|r/Regular Expression 2/. This indicates that both sides of the cursor are matched by regular expressions.
      • It's also possible to have only one side matched by a regular expression, such as: !|r/\[\[.+?\]\]/, which can match the scenario where a full-width exclamation mark is entered before a wiki link.
    • Unlike version V5.4.0, $n is no longer used to reference the content of captured match groups from regular expressions; instead, [[n]] is used for this purpose.
      • [[n]] represents the content of the n-th captured group, with n being a natural number starting from 0.
      • For the m-th captured group of Regular Expression 2, it is denoted as [[m+n]], where n is the count of captured groups from the first regular expression.
      • Example: A custom transformation rule that matches r/(?<=^|\n)([\w-]+)-call/| and transforms it to > [![[0]]] $0\n> $1 allows for input like note-call at the beginning of a line to be transformed into:
        > [!note] $0
        > $1
        
        Here, $0 and $1 represent two different cursors, which can be switched using the Tab key.
        multi-cursor

Other Updates

  • Multi-Language Support: Added support for multiple languages, including Simplified Chinese, Traditional Chinese, English, and Russian. #234. Thanks to niazlv.
  • Escape Character Fix: Resolved an issue where escape characters in custom delete/transform rules were not being escaped properly. #240.
  • Smart Space Improvement: Enhanced the intelligent space effect based on link aliases. #233.
  • Comment Support in Custom Regular Expression Areas: Lines beginning with // are now treated as comments. #173.

小Bug修复与严格换行时回车的优化

30 Jun 14:59
Compare
Choose a tag to compare
  • V5.4.1 2024-06-30 小 Bug 修复与严格换行时回车的优化
    • 优化严格换行回车产生两个换行符的功能
      • 光标在行首且上一行与当前行非空的情况回车不处理。
      • 如下一行非空白行,不做处理
    • 修复 getDefaultIndentChar 在默认 Ob 设置下的会返回错误结果的问题, #229 #230 #231

自定义规则支持正则表达式!

04 Jun 16:45
Compare
Choose a tag to compare

V5.4.0 2024-06-05 自定义规则支持正则表达式!

  • 转换前的匹配语法: r/正则表达式1/|r/正则表达式2/,这是光标左右都是正则表达式匹配的情况。
  • 也可以只有一边是正则表达式匹配,另一边是之前的匹配如: !|r/\[\[.+?\]\]/,可以匹配在 wiki 链接前输入全角叹号 的情况。
  • 对于转换后的字符串,在以前的功能基础上,还可以引用正则表达式匹配内的匹配组的内容(一般是正则表达式内小括号部分匹配成功的内容)
    • $n:匹配成功的第 n 组内容,n 是从 0 开始的自然数。
    • 对于 正则表达式 2 匹配的第 m 组内容,设置为 $(m+n),n 为第一个正则表达式匹配的组的数量。

例如:自定义转换规则,匹配 r/(?<=^|\n)(\w+)-call/|,转换成 > [!$0]\n> |,可以实现在文章行首输入 note-call,即可转换成

> [!note]
> |

而在行首输入 tip-call 时,自动转换成

> [!tip]
> |

自定义删除规则匹配 r/> \[![\w\d]+\].*?\n> /|,即可实现快速删除空的 callout 块,如在如下情况下按删除会将整个 callout 全部删除

> [!note]
> |

自定义删除/转换规则支持转义字符 #225

04 Jun 02:15
Compare
Choose a tag to compare
  • V5.3.4 2024-06-04 自定义删除/转换规则支持转义字符 #225
    • 可以在自定义删除/转换规则中使用转义字符 \,如 \n 是换行符。(支持\n \r \t
    • 输入 \| 时不会被当作光标,转换后也只输出 | 的结果

v5.3.3 一些功能修复与小优化

04 May 22:18
Compare
Choose a tag to compare
  • V5.3.3 2024-05-05 一些功能修复
    • 修复代码块粘贴某些情况智能缩进错误的问题
    • 修复中文输入法 IME 下,用户自定义规则在代码块中失效的问题
    • 优化代码块识别的功能,修复 CMD+A 某些情况的不精确选择问题
    • 修复 triggerPuncRectify 误触发导致的错误
    • 不再在时间戳左边添加软空格 #223
    • 使用 obsidian-typings - npm package 来使用未公开的 Obsidian API。

Small Fix

24 Apr 15:09
Compare
Choose a tag to compare
  • V5.3.2 2024-04-24 Small Fix
    • 修复:中文输入法下某些情况输入文字时转换规则不生效的问题 #221

增加代码块编辑体验增强功能

24 Apr 03:54
Compare
Choose a tag to compare
  • V5.3.1 2024-04-24 增加代码块编辑体验增强功能
    • 新功能:代码块编辑增强(可以在设置中切换关闭/打开)
      • 在代码块内,Cmd/Ctrl+A 会选中代码块
      • 增强代码块内的粘贴,会智能地缩进与删除多余空白符号
      • 增强列表下代码块内的删除按键,使光标始终在代码块有效区域
      • 增强代码块内Tab键的效果,Tab缩进的效果与编辑器设置中的使用制表符对应
      • 列表下代码块的创建和删除(此项始终开启,与设置开关无关)
    • 修复:中文输入法下如果回车或者数字键输入文字时转换规则不生效的问题 #221

新的输入法检测方式,适配更多输入法

16 Apr 07:52
Compare
Choose a tag to compare
  • V5.3.0 2024-04-16 新的输入法检测方式
    • 采用新的输入法输入检测方式,可能能适配更多输入法
    • 修复 normal-paste #218
    • 修复代码块快速删除

Obsidian 代码块内编辑的一系列优化

29 Mar 13:38
Compare
Choose a tag to compare
  • V5.2.3 2024-03-29 代码块编辑的一系列优化
    • 优化列表中空代码块的快速删除
    • 优化列表中代码块的快速创建(连按三次`)
    • 优化代码块中 Tab 键的功能,会根据Obsidian编辑器设置中的使用制表符设置,插入制表符或者空格
    • 优化代码块中粘贴代码的表现,会智能判断缩进
    • 优化表格内编辑的格式化处理代码,更简洁
    • 解决有时候文档末尾创建新行时报错的问题

功能修复与增强

16 Mar 23:06
Compare
Choose a tag to compare
  • v5.2.2 2024-03-17 功能修复与增强
    • 中英文间自动空格支持撤销(Ctrl+Z), 撤销后继续输入不会影响原内容。
    • 以回车开头的自定义转换规则也会在文档首行生效
    • 解决删除多余空白行和格式化全文时解析语法树可能不完整的问题。
    • 修复格式化当前行的功能有时候只格式化行的前面部分内容的问题。
    • 修复标点与中文间空格有时候失效的问题