Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractImageURLs ¶
ExtractImageURLs finds image URLs from <img src> tags and <figure data-trix-attachment> elements.
func FromMarkdown ¶ added in v1.0.0
FromMarkdown converts Markdown the user wrote into HTML for one of HEY's rich-text fields: a message body, a journal entry, a contact note, a snippet.
func MessageSourceText ¶ added in v0.2.0
MessageSourceText returns the source-backed text carried by HTML message content.
func PrependHTML ¶ added in v1.0.0
PrependHTML adds an HTML note before existing HTML content.
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 Markdown ¶ added in v0.2.0
type Markdown struct {
// contains filtered or unexported fields
}
Markdown is Markdown that ToMarkdown produced: every context serialized on its own terms, and no control character left in it other than the newlines and tabs that Markdown itself is written with — a fence keeps its tabs, and a sink that shows it sanitizes with the same two allowed. It is the only kind of Markdown markdown.Render accepts, and nothing but ToMarkdown can make one — the field is unexported and there is no constructor — so a body from anywhere else cannot reach a terminal renderer by being a string that happens to look like Markdown. It marshals to JSON as the string it holds, which is what --json carries.
func ToMarkdown ¶ added in v0.2.0
ToMarkdown converts HTML content to Markdown. Unlike ToText it keeps what a flattened email throws away: link URLs, emphasis, headings, list nesting, quotes, code blocks and tables. What it returns is the only Markdown markdown.Render accepts; see the Markdown type.
func (Markdown) IsEmpty ¶ added in v0.2.0
IsEmpty reports Markdown with nothing in it; IsZero is the same, for `omitzero`.
func (Markdown) MarshalText ¶ added in v0.2.0
MarshalText writes the Markdown as a JSON string.