Skip to content

Releases: hlyang1992/math-paste-bridge

1.0.6

Choose a tag to compare

@github-actions github-actions released this 07 Sep 15:45

Fix repeated copy and paste of already converted math.

Obsidian's editor copies both original Markdown and an HTML alternative. The paste handler now follows Obsidian's source preference, using the original Markdown and internal copy marker before inspecting HTML. This preserves formulas such as $y$ and avoids changing existing Markdown formatting on a second paste.

  • Still repairs eligible formulas when the clipboard contains Markdown only.
  • Keeps the same automatic, silent paste-only behavior.
  • 85 automated regression tests passed, including a fixture captured from Obsidian's real editor copy hook.
  • Desktop integration checks used Obsidian's native copy hook, native paste fallback, and the installed plugin: four samples across three clipboard variants remained identical over ten cycles each. The rendered sample retained all three formulas with no MathJax errors.
  • Physical iPhone clipboard behavior has not been tested. Copying rendered content without original TeX or Markdown remains subject to the documented source-recovery limit.

Install or update using main.js and manifest.json from this release.


修复“粘贴后的内容再次复制粘贴,公式和格式发生变化”。

优先保留 Obsidian 复制时提供的原始 Markdown,避免把附带 HTML 再转换一遍后丢失 $y$ 等公式或改变原有格式。仍然只在粘贴时自动处理,无快捷键、命令或设置页。

85 项自动测试通过;桌面 Obsidian 使用原生复制回调、原生粘贴后续处理和已安装插件验证,4 组样本 × 3 种剪贴板组合 × 10 轮均逐字一致。尚未进行 iPhone 实机测试。已有损坏内容不会自动重写,请从保留完整公式的原文重新复制。

1.0.5

Choose a tag to compare

@github-actions github-actions released this 04 Sep 23:34

Prevent extra dollar signs when pasting formulas whose delimiters and TeX source are split across HTML nodes.

  • Match existing $...$, $$...$$, \(...\), and \[...\] before recovering bare TeX, keeping each formula wrapped once and preserving its inline or display type.
  • Protect complete formula source through HTML-to-Markdown conversion, including complex TeX and Markdown-like text inside formulas.
  • Preserve surrounding bold/italic prose when placing display formulas outside inline formatting.
  • Respect code and table-cell boundaries. Leave incomplete formulas and already malformed dollar runs unchanged.
  • Keep the same silent paste-only interface.

Validation: 78 regression tests passed. The installed desktop plugin passed checks using Obsidian's real HTML conversion. Five formula fixtures rendered with no errors and no dollar-sign glyphs; these include reproductions of the two reported display formulas. Physical iPhone clipboard interaction has not been tested.

Install or update using the matching main.js and manifest.json assets below.

1.0.4

Choose a tag to compare

@github-actions github-actions released this 04 Sep 22:52

Recover pasted algebra that has no math delimiters or backslash commands.

  • Convert the complete equation y_t=m_{t+H}-m_t, including its left-hand side, into one inline formula in prose or a display formula on its own line.
  • Recognize complete TeX subscript/superscript expressions while preserving code, existing math, identifiers, filenames, and email addresses.
  • Preserve exact HTML math annotations and formatting when the clipboard contains them. An unmarked single letter or missing bold formatting cannot be reconstructed from plain text alone.
  • Keep silent automatic paste conversion, with no commands, shortcuts, or settings.

Validation: 65 regression tests passed, including the reported screenshot equation, HTML formatting preservation, and paste range isolation. The installed desktop plugin passed paste checks using Obsidian's HTML conversion; its MathJax renderer rendered the complete equation with all three subscripts and no errors. Physical iPhone clipboard interaction has not been tested.

Install or update using the matching main.js and manifest.json assets below.

1.0.3

Choose a tag to compare

@github-actions github-actions released this 04 Sep 22:38

Fix pasted formulas whose LaTeX source is present but math delimiters are missing.

  • Recover inline expressions such as \tau_t and standalone equations such as \text{age}_t=t-\tau_t.
  • Protect recognizable bare TeX in copied HTML before converting the surrounding formatting to Markdown.
  • Keep existing math, code, links, frontmatter, and ordinary prose intact. Incomplete or unsupported bare expressions remain unchanged.
  • Continue to work silently on paste, with no commands, shortcuts, or settings.

Validation: 58 regression tests passed. The installed desktop plugin passed in-memory paste checks using Obsidian's actual HTML conversion, and its MathJax renderer rendered both formulas in the reported sample without errors. Physical iPhone clipboard interaction has not been tested.

Install or update using the matching main.js and manifest.json assets below.

1.0.2 — Silent automatic paste

Choose a tag to compare

@github-actions github-actions released this 04 Sep 04:15

Install, enable, and paste. Math Paste Bridge now focuses exclusively on automatic, silent math conversion during paste.

  • Remove manual conversion commands and the settings page. No hotkeys, buttons, configuration, or conversion notifications are added.
  • Automatically convert paired LaTeX delimiters and recover exact formula sources preserved in copied HTML.
  • Preserve surrounding formatting, code, and existing math; leave ordinary paste to Obsidian when no eligible formula is found.
  • Process only the current paste, without scanning or rewriting existing notes.

Validated with 47 regression tests and the installed Obsidian paste listener using an in-memory editor and Obsidian's actual HTML conversion and math renderer. Mobile devices and end-to-end system clipboard/undo behavior have not been tested.

Download both main.js and manifest.json from this release for manual installation. Existing users only need to update and keep the plugin enabled.

Math Paste Bridge 1.0.1

Choose a tag to compare

@hlyang1992 hlyang1992 released this 04 Sep 03:48

First public release of Math Paste Bridge.

  • Automatically convert \(...\) to inline math and \[...\] to display math when pasting into Obsidian.
  • Recover exact TeX from HTML annotations while retaining surrounding Markdown formatting.
  • Preserve code, existing math, and list/blockquote structure; skip unsafe table conversions.
  • Provide commands to convert selected text or the current note.
  • Parse clipboard HTML in an inert document without assigning untrusted HTML to an element.

Download main.js and manifest.json into your vault's .obsidian/plugins/math-paste-bridge/ folder, then enable Math Paste Bridge. BRAT can also install hlyang1992/math-paste-bridge.

49 regression tests pass. The plugin declares desktop/mobile compatibility, but mobile devices have not been tested. Community directory submission is separate from this GitHub release.

首次公开发布。粘贴时自动转换公式,支持网页公式源码提取、选区和当前笔记转换。安装方法详见仓库内的中文说明。