Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 36 additions & 42 deletions extras/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,63 +5,57 @@ import (
)

type inlineTag struct {
TagKind ast.NodeKind
Char byte
Number int
Html string
WhitespaceAllowed bool
ParsePriority int
RenderPriority int
TagKind ast.NodeKind
Char byte
Number int
Html string
ParsePriority int
RenderPriority int
}

var superscriptTag = inlineTag{
TagKind: kindSuperscript,
Char: '^',
Number: 1,
Html: "sup",
WhitespaceAllowed: false,
ParsePriority: 600,
RenderPriority: 600,
TagKind: kindSuperscript,
Char: '^',
Number: 1,
Html: "sup",
ParsePriority: 600,
RenderPriority: 600,
}

var subscriptTag = inlineTag{
TagKind: kindSubscript,
Char: '~',
Number: 1,
Html: "sub",
WhitespaceAllowed: false,
ParsePriority: 602,
RenderPriority: 602,
TagKind: kindSubscript,
Char: '~',
Number: 1,
Html: "sub",
ParsePriority: 602,
RenderPriority: 602,
}

var insertTag = inlineTag{
TagKind: kindInsert,
Char: '+',
Number: 2,
Html: "ins",
WhitespaceAllowed: true,
ParsePriority: 501,
RenderPriority: 501,
TagKind: kindInsert,
Char: '+',
Number: 2,
Html: "ins",
ParsePriority: 501,
RenderPriority: 501,
}

var markTag = inlineTag{
TagKind: kindMark,
Char: '=',
Number: 2,
Html: "mark",
WhitespaceAllowed: true,
ParsePriority: 550,
RenderPriority: 550,
TagKind: kindMark,
Char: '=',
Number: 2,
Html: "mark",
ParsePriority: 550,
RenderPriority: 550,
}

var deleteTag = inlineTag{
TagKind: kindDelete,
Char: '~',
Number: 2,
Html: "del",
WhitespaceAllowed: false,
ParsePriority: 400,
RenderPriority: 400,
TagKind: kindDelete,
Char: '~',
Number: 2,
Html: "del",
ParsePriority: 400,
RenderPriority: 400,
}

type inlineTagNode struct {
Expand Down
4 changes: 2 additions & 2 deletions extras/inline.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type inlineTagHTMLRenderer struct {
html.Config
}

// newInlineTagHTMLRenderer returns a new NodeRenderer that renders InlineTaast.Node nodes to HTML.
// newInlineTagHTMLRenderer returns a new NodeRenderer that renders Inline nodes to HTML.
func newInlineTagHTMLRenderer(tag inlineTag, opts ...html.Option) renderer.NodeRenderer {
r := &inlineTagHTMLRenderer{
htmlTag: tag.Html,
Expand Down Expand Up @@ -107,7 +107,7 @@ type inlineExtension struct {
conf Config
}

// Config confitures the extras extension.
// Config configures the extras extension.
type Config struct {
Superscript SuperscriptConfig
Subscript SubscriptConfig
Expand Down