Documentation
¶
Index ¶
Constants ¶
View Source
const ( // TODO: Interpret as single if there is no closing tag PossibleSingle int = 1 << iota // TODO: This makes MoeParser ignore any tags inside this tags body. It will be ignored if the Single bit is set. NoParseInner // TODO: This makes the text inside of tag and passes it as an arg for the output. The text inside will not be parsed. TokenBodyAsArg // TODO: This makes the tag body become the first arg if there is no first argument (makes [name]arg0[/name] the same as [name=arg0][/name]) AllowTokenBodyAsFirstArg // TODO: remove Converts a number to the number + "px" (ie 12 -> 12px) NumberArgToPx // TODO: This makes MoeParser match the tags that don't either start with whitespace or the beginning of a line. This is only useful if the token is of the type OpenCloseClass. AllowMidWord // TODO: This makes MoeParser stop matching: // - OpenClass type tokens without leading whitespace/beginning of body // - CloseClass type tokens without trailing whitespace/end of body // - Single type tokens without leading and trailing whitespace DisallowMidWord // For compatibility with the bbcode module until it's folded into the moeparsing routines HtmlSingle )
Options for Tokens - return these bits in GetOptions() to implement this behavior
View Source
const ( // A single token with no opening or closing token SingleToken int = iota // A token class that starts a section OpenToken // A token class that ends a section CloseToken // A token class that can both begin and end a section SymmetricToken )
Token class types - return these in GetType()
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TextToken ¶
type TextToken struct {
// contains filtered or unexported fields
}
A special case of Token used to represent text that isn't matched by any other tokens i.e. "hi" in <p>hi</p>
func NewTextToken ¶
type Token ¶
type Token interface {
Type() string
}
The Token interface represents an instance of a token class
type TokenArgs ¶
type TokenArgs struct {
// contains filtered or unexported fields
}
The arguments for a token - these are the regexp capture groups
type TokenBuilder ¶
Click to show internal directories.
Click to hide internal directories.