@a2ui/markdown-it
v0.0.1
Published
A Markdown renderer using markdown-it and dompurify.
Downloads
579
Readme
Markdown renderer for A2UI using markdown-it and dompurify.
This is used across all JS renderers, so the configuration is consistent. This
package provides a pre-configured renderMarkdown function that is injected
into the respective Markdown Renderer service of each renderer.
(See the samples directory for examples and the README of each renderer on
how to use this package.)
Development
Build
Run npm run build to build the project. The build artifacts will be stored in the dist/ directory.
Running unit tests
Run npm test to execute the unit tests.
[!NOTE] This package uses
dompurifywhich requires a Window object. For unit testing in a Node.js environment,jsdommust be provided globally before importing the renderer.
Code Formatting
This project uses Prettier for code formatting. The configuration is defined in ../.prettierrc.
To format all files in the project:
npm run formatTo check the format, run:
npx run format:checkMost IDEs (like VS Code) can be configured to Format On Save using the local Prettier version and configuration. This is the recommended workflow.
