百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
O

opencode-md-table-formatter

> 编程语言
开源

OpenCode 有隐藏模式支持的标出表的事务插件 .

370 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

OpenCode 有隐藏模式支持的标出表的事务插件 .

@franlol/opencode-md-table-formatter

Markdown table formatter plugin for Opencode with concealment mode support.

Usage

Add the plugin to your .opencode/opencode.jsonc:

jsonc
{
  "plugin": ["@franlol/opencode-md-table-formatter@latest"],
}

Example

Original
Formatted

Features

  • Automatic table formatting - Formats markdown tables after AI text completion
  • Concealment mode compatible - Correctly calculates column widths when markdown symbols are hidden
  • Alignment support - Left (:---), center (:---:), and right (---:) text alignment
  • Nested markdown handling - Strips bold, italic, strikethrough with multi-pass algorithm
  • Code block preservation - Preserves markdown symbols inside inline code (`**bold**`)
  • Edge case handling - Emojis, unicode characters, empty cells, long content
  • Silent operation - No console logs, errors don't interrupt workflow
  • Validation feedback - Invalid tables get helpful error comments

Key behaviors:

  • Bold/italic symbols outside code are hidden by concealment but width calculated correctly
  • **bold** inside backticks shows as literal text with proper spacing
  • Emojis and unicode characters align properly
  • Columns have consistent spacing

How It Works

This plugin uses Opencode's experimental.text.complete hook to format markdown tables after the AI finishes generating text. It intelligently strips markdown symbols (for width calculation) while preserving symbols inside inline code blocks, ensuring tables align correctly ONLY with Opencode's concealment mode enabled (the default setting).

The plugin uses a multi-pass regex algorithm to handle nested markdown (like **bold with code inside**) and caches width calculations for performance.

Troubleshooting

Tables not formatting?

  • Ensure the plugin is listed in your .opencode/opencode.jsonc config
  • Restart Opencode after adding the plugin
  • Check that tables have a separator row (|---|---|)

Invalid table structure comment?

  • The plugin validates tables before formatting
  • All rows must have the same number of columns
  • Tables must have at least 2 rows including the separator

Requirements

  • Opencode >= 1.0.137

License

MIT © franlol

Links

  • GitHub Repository
  • npm Package
  • Report Issues

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言