text

package
v0.0.0-...-811c2de Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderMarkdown

func RenderMarkdown(in string) string

Types

type Markdown

type Markdown struct{}

The text/markdown content type.

func (*Markdown) RenderDisplayContent

func (c *Markdown) RenderDisplayContent(content interface{}) (string, error)

Render the markdown, sanitize the output, and return that for display.

func (*Markdown) RenderIndexContent

func (c *Markdown) RenderIndexContent(content interface{}) (string, error)

Simply return the markdown for indexing.

func (*Markdown) Safe

func (c *Markdown) Safe() bool

Since the content is sanitized, this content type is safe.

type Plain

type Plain struct{}

The text/plain content type.

func (*Plain) RenderDisplayContent

func (c *Plain) RenderDisplayContent(content interface{}) (string, error)

Sanitize the output, replace newlines with HTML line breaks, and return the modified content.

func (*Plain) RenderIndexContent

func (c *Plain) RenderIndexContent(content interface{}) (string, error)

Simply return the content.

func (*Plain) Safe

func (c *Plain) Safe() bool

Since the display content is sanitized, this content type is safe.

type Raw

type Raw struct{}

The text/raw content type.

func (*Raw) RenderDisplayContent

func (c *Raw) RenderDisplayContent(content interface{}) (string, error)

Simply returns the content.

func (*Raw) RenderIndexContent

func (c *Raw) RenderIndexContent(content interface{}) (string, error)

Simply returns the content.

func (*Raw) Safe

func (c *Raw) Safe() bool

This should only ever be used for testing, as it does not sanitize output in any way.

Jump to

Keyboard shortcuts

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