npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@franlol/opencode-md-table-formatter

v0.0.3

Published

Markdown table formatter plugin for OpenCode with concealment mode support

Downloads

323

Readme

@franlol/opencode-md-table-formatter

Markdown table formatter plugin for Opencode with concealment mode support.

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

Usage

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

{
  "plugin": ["@franlol/[email protected]"],
}

Restart Opencode. Tables in AI responses will now be automatically formatted!

Example

The plugin handles complex edge cases with concealment mode enabled:

Input (unformatted table with nested markdown):

| Feature | Description | Status |
|---|---|
| **Bold text** | Has *italic* content | ✅ Done |
| `Code` | With `**bold**` inside | ⏳ Progress |
| Unicode | Greek α β γ | 💡 Idea |

Output (automatically formatted):

| Feature       | Description            | Status      |
| ------------- | ---------------------- | ----------- |
| **Bold text** | Has *italic* content   | ✅ Done     |
| `Code`        | With `**bold**` inside | ⏳ Progress |
| Unicode       | Greek α β γ            | 💡 Idea     |

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 CLI
  • Node.js >= 18.0.0 or Bun runtime
  • @opencode-ai/plugin >= 0.13.7

License

MIT © franlol

Links