mdhtml

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package mdhtml converts a narrow Markdown dialect into the HTML subset that Plextrac's Quill-based editor preserves on save.

Plextrac strips style and class attributes from most tags, so this converter emits only tags whose default rendering is preserved: <p>, <h1>/<h2>/<h3>, <ul>/<ol>/<li>, <strong>, <code>, <pre>, <hr>.

Supported Markdown:

  • ATX headings (#, ##, ###)
  • Unordered lists: lines matching `-\s+...` or `*\s+...`
  • Ordered lists: `\d+\.\s+...`
  • Inline code: `code`
  • Bold: **bold**
  • Horizontal rule: --- or *** alone on a line
  • Fenced code blocks: ``` ... ``` (language ignored, indent preserved)

Everything is HTML-escaped before formatting tags are re-injected. The input is pre-decoded via html.UnescapeString so explicit entities round- trip instead of double-encoding.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(md string) string

Convert renders md as Plextrac-safe HTML.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL