Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Markdown Cleaner

gao-qian-longgao-qian-long165 downloads

Clean Markdown syntax and automatically convert LaTeX to a compatible format.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates1

English | 中文


English Version

A powerful Obsidian plugin for cleaning Markdown formatting and intelligently converting mathematical formulas. Supports hotkey cleaning, paste auto-cleaning, and LaTeX math formula format conversion.

✨ Core Features

Markdown Format Cleaning

  • Smart Cleaning: Automatically identifies and cleans excess **, __ and other formatting symbols
  • Preserve Valid Formats: Keeps normal bold **bold** and italic *italic* unchanged
  • Customizable Hotkey: Set your own hotkey in Obsidian Settings → Hotkeys (search for "Clean Markdown format")
  • Paste Auto-Cleaning: Automatically cleans excess formatting in pasted content when enabled

Math Formula Conversion

  • LaTeX Format Conversion: Automatically converts \(...\) to $...$ (inline) and \[...\] to $$...$$ (block)
  • Complex Formula Support: Perfectly handles \frac, \sqrt, \sum, matrices, etc.

📦 Installation

For End Users

  1. Download from GitHub Releases
  2. Extract and rename to obsidian-markdown-cleaner
  3. Copy to Obsidian vault's .obsidian/plugins/ directory
  4. Enable in Obsidian Settings → Third-party plugins

For Developers

git clone https://github.com/Gao-Qian-Long/obsidian-markdown-cleaner.git
cd obsidian-markdown-cleaner
npm install
npm run build

🚀 Usage

Enable Plugin

  1. Open Obsidian Settings
  2. Go to Third-party plugins → Markdown Cleaner
  3. Configure features as needed:
    • ✅ Auto-clean on paste
    • ✅ Show notification
    • ✅ Convert math formulas

Set Hotkey

  1. Go to Settings → Hotkeys
  2. Search for "Clean Markdown format"
  3. Click to set your preferred hotkey

Quick Start

  • Hotkey: Select text → Press your configured hotkey
  • Paste: Automatically cleans and converts formulas

🔢 Math Formula Conversion

Original Converted Description
\(E = mc^2\) $E = mc^2$ Inline formula
\[x = \frac{-b}{2a}\] $$x = \frac{-b}{2a}$$ Block formula

Supported LaTeX Commands

  • Fraction: \frac{num}{den}
  • Square root: \sqrt{}
  • Greek letters: \alpha, \beta, \gamma, \omega, \zeta
  • Operators: \sum, \int, \prod
  • Special symbols: \pm, \leq, \geq, \neq, \approx

⚙️ Settings

Setting Default Description
Auto-clean on paste Enabled Auto-clean when pasting
Show notification Enabled Display notification when cleaning
Convert math formulas Enabled LaTeX conversion

❓ FAQ

Q: Formula conversion not working?

  1. Check if "Convert math formulas" is enabled
  2. Ensure using \(...\) or \[...\] format
  3. Restart Obsidian

Q: How to set hotkey?

  1. Go to Settings → Hotkeys
  2. Search for "Clean Markdown format"
  3. Click and press your desired key combination

Q: Hotkey not working?

  1. Make sure you've set a hotkey in Settings → Hotkeys
  2. Restart Obsidian
  3. Check for conflicts with other plugins

🛠️ Development

Build Commands

npm install    # Install dependencies
npm run dev    # Development mode
npm run build  # Production build

Project Structure

obsidian-markdown-cleaner/
├── main.ts           # Source code
├── main.js           # Built plugin
├── manifest.json     # Plugin metadata
├── package.json      # npm config
├── tsconfig.json     # TypeScript config
├── esbuild.config.mjs # Build config
└── README.md         # Documentation

📋 Changelog

v1.1.1 (Latest)

  • 🐛 Fixed: Code review issues (remove console.log, use setHeading())
  • 🔧 Fixed: Remove default hotkey and unused enableHotkey setting
  • 📝 Updated: Documentation with new hotkey setup instructions
  • 🔧 Fixed: .gitignore issues

v1.1.0

  • ✨ New: LaTeX math formula auto-conversion
  • 🔧 Enhanced: Complex formula support
  • 🐛 Fixed: Regex matching issues
  • 📝 Updated: Complete documentation

v1.0.x

  • Initial release with Markdown format cleaning

🤝 Contributing

Welcome! Submit Issues and Pull Requests.

📄 License

MIT License

📞 Contact

  • GitHub: https://github.com/Gao-Qian-Long/obsidian-markdown-cleaner
  • Issues: https://github.com/Gao-Qian-Long/obsidian-markdown-cleaner/issues

中文版本

一个功能强大的 Obsidian 插件,专门用于清理 Markdown 格式并智能转换数学公式。支持快捷键清理、粘贴自动清理和 LaTeX 数学公式格式转换。

✨ 核心功能

Markdown 格式清理

  • 智能清理:自动识别并清理多余的 **、__ 等格式符号
  • 保留有效格式:保持正常的加粗 **bold**、斜体 *italic* 不变
  • 自定义快捷键:在 Obsidian 设置 → 快捷键中设置你自己的快捷键(搜索 "Clean Markdown format")
  • 粘贴自动清理:开启后可自动清理粘贴内容中的多余格式

数学公式转换

  • LaTeX 格式转换:\(...\) → $...$(行内公式),\[...\] → $$...$$(块级公式)
  • 复杂公式支持:完美处理 \frac、\sqrt、\sum、矩阵等

📦 安装方法

普通用户(推荐)

  1. 从 GitHub Releases 下载最新版本
  2. 解压并重命名为 obsidian-markdown-cleaner
  3. 复制到 Obsidian 库的 .obsidian/plugins/ 目录
  4. 在 Obsidian 设置 → 第三方插件中启用

开发者

git clone https://github.com/Gao-Qian-Long/obsidian-markdown-cleaner.git
cd obsidian-markdown-cleaner
npm install
npm run build

🚀 使用方法

启用插件

  1. 打开 Obsidian 设置
  2. 进入 第三方插件 → Markdown Cleaner
  3. 根据需要配置功能:
    • ✅ 粘贴时自动清理
    • ✅ 显示通知
    • ✅ 转换数学公式

设置快捷键

  1. 进入 设置 → 快捷键
  2. 搜索 "Clean Markdown format"
  3. 点击设置你想要的快捷键

快速开始

  • 快捷键:选中文本 → 按你设置的快捷键
  • 粘贴:自动清理并转换公式

🔢 数学公式转换

原始格式 转换结果 说明
\(E = mc^2\) $E = mc^2$ 行内公式
\[x = \frac{-b}{2a}\] $$x = \frac{-b}{2a}$$ 块级公式

支持的 LaTeX 命令

  • 分数:\frac{分子}{分母}
  • 根号:\sqrt{}
  • 希腊字母:\alpha、\beta、\gamma、\omega、\zeta
  • 运算符:\sum、\int、\prod
  • 特殊符号:\pm、\leq、\geq、\neq、\approx

⚙️ 设置选项

选项 默认 说明
粘贴时自动清理 开启 粘贴内容时自动清理
显示通知 开启 清理完成后显示通知
转换数学公式 开启 LaTeX 格式转换

❓ 常见问题

Q: 公式转换不生效?

  1. 检查设置中"转换数学公式"是否开启
  2. 确保使用 \(...\) 或 \[...\] 格式
  3. 重启 Obsidian

Q: 如何设置快捷键?

  1. 进入设置 → 快捷键
  2. 搜索 "Clean Markdown format"
  3. 点击并按下你想要的按键组合

Q: 快捷键不生效?

  1. 确保已在设置 → 快捷键中设置了快捷键
  2. 重启 Obsidian
  3. 检查是否与其他插件冲突

🛠️ 开发指南

构建命令

npm install    # 安装依赖
npm run dev    # 开发模式
npm run build  # 生产构建

项目结构

obsidian-markdown-cleaner/
├── main.ts           # 源代码
├── main.js           # 构建后的插件
├── manifest.json      # 插件元数据
├── package.json       # npm配置
├── tsconfig.json      # TypeScript配置
├── esbuild.config.mjs # 构建配置
└── README.md         # 文档

📋 更新日志

v1.1.1(最新)

  • 🐛 修复:代码审核问题(删除 console.log,使用 setHeading())
  • 🔧 修复:移除默认快捷键和无用的 enableHotkey 设置项
  • 📝 更新:文档中添加快捷键设置说明
  • 🔧 修复:.gitignore 问题

v1.1.0

  • ✨ 新增:LaTeX 数学公式自动转换
  • 🔧 优化:复杂公式支持
  • 🐛 修复:正则表达式问题
  • 📝 更新:完整中文文档

v1.0.x

  • 首次发布,包含 Markdown 格式清理功能

🤝 贡献

欢迎提交 Issue 和 Pull Request!

📄 许可证

MIT License

📞 联系方式

  • GitHub: https://github.com/Gao-Qian-Long/obsidian-markdown-cleaner
  • 问题反馈: https://github.com/Gao-Qian-Long/obsidian-markdown-cleaner/issues

希望这个插件能提升你在 Obsidian 中的编辑体验! 🚀

83%
HealthExcellent
ReviewSatisfactory
About
Clean excessive Markdown formatting while preserving valid bold and italic, removing stray *, _, and other redundant markers. Convert LaTeX math delimiters \(...\) to $...$ and \[...\] to $$...$$ for complex formulas (fractions, roots, sums, matrices), with paste auto-clean and hotkey-triggered cleaning.
MarkdownLaTeXAutomation
Details
Current version
1.1.1
Last updated
Last month
Created
Last month
Updates
1 release
Downloads
165
Compatible with
Obsidian 0.15.0+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
gao-qian-longgao-qian-long
github.com/Gao-Qian-Long
GitHubgao-qian-long
  1. Community
  2. Plugins
  3. Markdown
  4. Markdown Cleaner

Related plugins

Linter

Format and style your notes. Linter can be used to format YAML tags, aliases, arrays, and metadata; footnotes; headings; spacing; math blocks; regular Markdown contents like list, italics, and bold styles; and more with the use of custom rule options.

Auto Link Title

Automatically fetches the titles of links from the web.

Link Embed

Convert URLs in your notes into embeded previews.

QuickAdd

Quickly add new notes or content to your vault.

Templater

Create and use dynamic templates.

Homepage

Open a note, base, or workspace on startup, or set it for quick access later.

Importer

Import data from Notion, Evernote, Apple Notes, Microsoft OneNote, Google Keep, Bear, Roam, and HTML files.

BRAT

Easily install a beta version of a plugin for testing.

Outliner

Work with your lists like in Workflowy or Roam Research.

Various Complements

Complete words similar to auto-completion in an IDE.