htmlutil

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractImageURLs

func ExtractImageURLs(s string) []string

ExtractImageURLs finds image URLs from <img src> tags and <figure data-trix-attachment> elements.

func ParseTopicEntriesHTML

func ParseTopicEntriesHTML(html string) []models.Entry

ParseTopicEntriesHTML extracts structured entry data from the HTML page served by /topics/{id}/entries. The JSON API does not return full entry bodies, so this HTML-based extraction is required.

func PrependText

func PrependText(content, note string) string

PrependText adds a plain-text note before existing HTML content.

func ToText

func ToText(s string) string

ToText converts HTML content to plain text, preserving basic structure.

Types

type Attachment

type Attachment struct {
	URL         string
	Filename    string
	ContentType string
	ByteSize    *int64
	SGID        string
}

Attachment describes a downloadable file embedded in rich-text content.

func ExtractAttachments

func ExtractAttachments(s string) []Attachment

ExtractAttachments returns downloadable files in their document order.

type TopicAddressed

type TopicAddressed struct {
	To  []string
	CC  []string
	BCC []string
}

TopicAddressed holds the To, CC, and BCC recipients for a topic.

func ParseTopicAddressed

func ParseTopicAddressed(html string) *TopicAddressed

ParseTopicAddressed extracts To/CC/BCC recipients from a topic's HTML page.

Jump to

Keyboard shortcuts

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