mp-html is a rich-text component for mini-programs that renders and edits HTML content across multiple platforms.
The component solves the problem of displaying formatted HTML content in mini-program environments where native HTML rendering is not available. It parses HTML input and converts it into platform-specific markup, supporting a wide range of tags including tables, videos, and SVG elements. The tool handles rich event interactions such as automatic image preview, link handling, and anchor-point navigation. It includes features like placeholder images for loading and error states, long-press copy functionality, and support for most HTML entities.
The tool suits developers building mini-programs on WeChat, QQ, Baidu, Alipay, ByteDance, or using uni-app who need to display user-generated or server-provided HTML content. It is particularly valuable for applications requiring content editing capabilities, as the project offers plugins for keyword search, content editing, and LaTeX formula rendering. The component is lightweight at approximately 25KB uncompressed and 9KB gzipped, making it suitable for performance-sensitive mini-program environments where bundle size matters.
Development activity shows consistent engagement with issue resolution and feature requests. The project maintains comprehensive documentation with dedicated sections for quick-start guides and feature overviews. Test coverage is tracked and publicly reported. The codebase follows a standard JavaScript style guide, indicating attention to code quality standards. Multiple installation methods are supported, including npm packages and source code distribution across different platform variants, suggesting the maintainers prioritize accessibility for different development workflows.