htmlutil

package
v0.1.1-rc.2 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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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