@prjct.app/pi-markdown

Fix malformed single-line Markdown code fences in PI Agent responses so code blocks display correctly.

Packages

Package details

extension

Install @prjct.app/pi-markdown from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@prjct.app/pi-markdown
Package
@prjct.app/pi-markdown
Version
0.1.3
Published
Sep 10, 2026
Downloads
565/mo · 565/wk
Author
jlopezlira
License
MIT
Types
extension
Size
12.7 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ],
  "image": "https://raw.githubusercontent.com/prjct-app/pi-clipboard/main/docs/covers/pi-markdown.png"
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-markdown

pi-markdown — extension for PI Agent

Fix malformed single-line Markdown code fences in PI Agent responses so code blocks display correctly.

@prjct.app/pi-markdown · Assistant Markdown display transformer; one extension.

Install

Requires Pi installed separately and Node.js 22.19 or later. Compatibility is tested with Pi 0.85.1; newer versions are not yet verified. This is an independent community package.

Install with Pi's package manager:

pi install npm:@prjct.app/pi-markdown

For project-only installation, add -l: pi install -l npm:@prjct.app/pi-markdown. Restart Pi after installation. Do not install the same extension from both GitHub and npm: Pi treats those as different package identities.

Usage

The transformer runs automatically when an assistant response finishes. For example, a malformed single-line fenced snippet is displayed as a normal code block:

Before:

```bash npm test```

After:

```bash
npm test
```

Existing multiline code blocks and ordinary Markdown are preserved. This is a focused display normalizer, not a general Markdown formatter. It leaves streaming output, user messages, thinking blocks, stored session text, and model context unchanged.

Manage the package

For an npm installation:

pi list
pi update npm:@prjct.app/pi-markdown
pi remove npm:@prjct.app/pi-markdown

Use pi config to enable or disable individual resources. Use pi config -l for project settings and add -l to removal when you installed locally.

To pin version 0.1.3, use pi install npm:@prjct.app/pi-markdown@0.1.3. Pi skips pinned npm versions during package updates. For a Git installation, update or remove using the same git:github.com/prjct-app/pi-markdown source instead of the npm source.

When switching from GitHub to npm, remove the Git installation first, then install the npm package and restart Pi.

Troubleshooting

Wait until the assistant response finishes. The extension does not reformat streaming text or arbitrary inline code. If it is disabled, enable its extension resource with pi config.

Package and API documentation

Registers the documented pi.registerMarkdownTransformer() hook and filters for finalized assistant messages.

See Package structure and compatibility for the manifest, dependency policy, shipped resources, and official references. This package follows the official Pi package guide and extension API guide for the tested version.

Development

From a repository checkout:

npm ci --ignore-scripts
npm run check
npm test
npm run check:package

Pi loads the TypeScript entry point directly; no build step is required. To try this checkout for one run, use pi -e .. Tests use isolated temporary state and do not call model APIs. See CONTRIBUTING.md for contribution rules and CHANGELOG.md for release notes.

License

MIT.