markdown

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package markdown provides a simple Markdown-to-HTML renderer as a templ component.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyOutsideTags

func ApplyOutsideTags(s string, fn func(string) string) string

ApplyOutsideTags applies fn only to text segments outside HTML tags, so that formatting regexes never touch URLs inside href attributes, etc.

func FormatInline

func FormatInline(s string, imageCount *int) string

FormatInline applies inline formatting (bold, italic, links, images) to s.

func Markdown

func Markdown(content string) templ.Component

Markdown returns a templ.Component that renders md as HTML.

func RenderMarkdown

func RenderMarkdown(buf *bytes.Buffer, md string)

RenderMarkdown writes the HTML representation of md to buf.

func SafeURL

func SafeURL(raw string) string

SafeURL validates and sanitizes a URL for use in HTML attributes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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