Documentation ¶
Index ¶
Constants ¶
View Source
const ( MentionType = "mention" ReferenceType = "reference" )
Variables ¶
View Source
var Hyphenate = false
Hyphenate controls whether or not texts should have hyphens on wrap.
Functions ¶
func FragmentImageSize ¶
FragmentImageSize tries to parse the width and height encoded in the URL fragment, which is inserted by the markup renderer. A pair of zero values are returned if there is none. The returned width and height will be the minimum of the given maxes and the encoded sizes.
Types ¶
type MentionSegment ¶
MentionSegment is a type that satisfies both Segment and Mentioner.
type ReferenceSegment ¶
type ReferenceSegment struct { text.Segment text.MessageReferencer }
ReferenceSegment is a type that satisfies both Segment and MessageReferencer.
type RenderConfig ¶
type RenderConfig struct { // NoMentionLinks, if true, will not render any mentions. NoMentionLinks bool // NoReferencing, if true, will not parse reference links and prefer // mentions. NoReferencing bool // SkipImages skips rendering any image markup. This is useful for widgets // that already render an outside image. SkipImages bool // AnchorColor forces all anchors to be of a certain color. This is used if // the boolean is true. Else, all mention links will not work and regular // links will be of the default color. AnchorColor struct { // contains filtered or unexported fields } }
type RenderOutput ¶
type RenderOutput struct { Markup string Input string // useless to keep parts, as Go will keep all alive anyway Mentions []MentionSegment References []ReferenceSegment }
RenderOutput is the output of a render.
func RenderCmplx ¶
func RenderCmplx(content text.Rich) RenderOutput
RenderCmplx renders content into a complete output.
func RenderCmplxWithConfig ¶
func RenderCmplxWithConfig(content text.Rich, cfg RenderConfig) RenderOutput
func (RenderOutput) URISegment ¶
func (r RenderOutput) URISegment(uri string) text.Segment
Click to show internal directories.
Click to hide internal directories.