What is <zero-md>?
main<zero-md> is a zero-config markdown-to-html web component designed to load and display external Markdown files. It is built on the Custom Elements V1 specification and uses Marked for transformation and Prism for syntax highlighting. The component renders content into its own self-contained shadow DOM container.
Key Features:
- Automated hash-link scrolls.
- Built-in FOUC (Flash of Unstyled Content) prevention.
- Automatic URL rewriting relative to the
srcattribute. - Automatic re-rendering when the
srcattribute or inline markdown/style templates change. - Support for >200 code languages with automatic detection.
- Easy styling mechanism and high extensibility.
Important Security Note: Markdown files must be hosted on a web server. Due to browser security restrictions, you cannot access local files directly via the file system. Standard CORS (Cross-Origin Resource Sharing) rules apply when loading files from different domains.