diff --git a/ast/block.go b/ast/block.go index f63619f..f5bca33 100644 --- a/ast/block.go +++ b/ast/block.go @@ -303,11 +303,11 @@ func NewBlockquote() *Blockquote { } } -// A List structr represents a list of Markdown text. +// A List struct represents a list of Markdown text. type List struct { BaseBlock - // Marker is a markar character like '-', '+', ')' and '.'. + // Marker is a marker character like '-', '+', ')' and '.'. Marker byte // IsTight is a true if this list is a 'tight' list. @@ -364,7 +364,7 @@ func NewList(marker byte) *List { type ListItem struct { BaseBlock - // Offset is an offset potision of this item. + // Offset is an offset position of this item. Offset int } diff --git a/ast/inline.go b/ast/inline.go index da0f720..23dcad4 100644 --- a/ast/inline.go +++ b/ast/inline.go @@ -170,7 +170,7 @@ func NewText() *Text { } } -// NewTextSegment returns a new Text node with the given source potision. +// NewTextSegment returns a new Text node with the given source position. func NewTextSegment(v textm.Segment) *Text { return &Text{ BaseInline: BaseInline{}, @@ -467,7 +467,7 @@ type AutoLink struct { // Inline implements Inline.Inline. func (n *AutoLink) Inline() {} -// Dump implenets Node.Dump +// Dump implements Node.Dump func (n *AutoLink) Dump(source []byte, level int) { segment := n.value.Segment m := map[string]string{ diff --git a/extension/ast/tasklist.go b/extension/ast/tasklist.go index 90b451b..670cc14 100644 --- a/extension/ast/tasklist.go +++ b/extension/ast/tasklist.go @@ -11,7 +11,7 @@ type TaskCheckBox struct { IsChecked bool } -// Dump impelemtns Node.Dump. +// Dump implements Node.Dump. func (n *TaskCheckBox) Dump(source []byte, level int) { m := map[string]string{ "Checked": fmt.Sprintf("%v", n.IsChecked), diff --git a/extension/linkify.go b/extension/linkify.go index 565c6bd..9e68fa5 100644 --- a/extension/linkify.go +++ b/extension/linkify.go @@ -61,7 +61,7 @@ func (o *withLinkifyAllowedProtocols) SetLinkifyOption(p *LinkifyConfig) { p.AllowedProtocols = o.value } -// WithLinkifyAllowedProtocols is a functional otpion that specify allowed +// WithLinkifyAllowedProtocols is a functional option that specify allowed // protocols in autolinks. Each protocol must end with ':' like // 'http:' . func WithLinkifyAllowedProtocols(value [][]byte) LinkifyOption { @@ -82,7 +82,7 @@ func (o *withLinkifyURLRegexp) SetLinkifyOption(p *LinkifyConfig) { p.URLRegexp = o.value } -// WithLinkifyURLRegexp is a functional otpion that specify +// WithLinkifyURLRegexp is a functional option that specify // a pattern of the URL including a protocol. func WithLinkifyURLRegexp(value *regexp.Regexp) LinkifyOption { return &withLinkifyURLRegexp{ @@ -90,7 +90,7 @@ func WithLinkifyURLRegexp(value *regexp.Regexp) LinkifyOption { } } -// WithLinkifyWWWRegexp is a functional otpion that specify +// WithLinkifyWWWRegexp is a functional option that specify // a pattern of the URL without a protocol. // This pattern must start with 'www.' . type withLinkifyWWWRegexp struct { diff --git a/extension/table.go b/extension/table.go index 309f3f9..91ba331 100644 --- a/extension/table.go +++ b/extension/table.go @@ -27,7 +27,7 @@ type tableParagraphTransformer struct { var defaultTableParagraphTransformer = &tableParagraphTransformer{} // NewTableParagraphTransformer returns a new ParagraphTransformer -// that can transform pargraphs into tables. +// that can transform paragraphs into tables. func NewTableParagraphTransformer() parser.ParagraphTransformer { return defaultTableParagraphTransformer } diff --git a/extension/typographer.go b/extension/typographer.go index 106e0b2..fc40402 100644 --- a/extension/typographer.go +++ b/extension/typographer.go @@ -253,10 +253,10 @@ type typographer struct { options []TypographerOption } -// Typographer is an extension that repalace punctuations with typographic entities. +// Typographer is an extension that replaces punctuations with typographic entities. var Typographer = &typographer{} -// NewTypographer returns a new Entender that repalace punctuations with typographic entities. +// NewTypographer returns a new Extender that replaces punctuations with typographic entities. func NewTypographer(opts ...TypographerOption) goldmark.Extender { return &typographer{ options: opts, diff --git a/parser/delimiter.go b/parser/delimiter.go index 50aa7bd..612d7b7 100644 --- a/parser/delimiter.go +++ b/parser/delimiter.go @@ -11,7 +11,7 @@ import ( ) // A DelimiterProcessor interface provides a set of functions about -// Deliiter nodes. +// Delimiter nodes. type DelimiterProcessor interface { // IsDelimiter returns true if given character is a delimiter, otherwise false. IsDelimiter(byte) bool @@ -38,7 +38,7 @@ type Delimiter struct { // See https://spec.commonmark.org/0.29/#can-open-emphasis for details. CanClose bool - // Length is a remaining length of this delmiter. + // Length is a remaining length of this delimiter. Length int // OriginalLength is a original length of this delimiter. diff --git a/parser/parser.go b/parser/parser.go index d6cb066..def13db 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -459,7 +459,7 @@ type Parser interface { // Parse parses the given Markdown text into AST nodes. Parse(reader text.Reader, opts ...ParseOption) ast.Node - // AddOption adds the given option to thie parser. + // AddOption adds the given option to this parser. AddOptions(...Option) } @@ -505,7 +505,7 @@ type BlockParser interface { // Close will be called when the parser returns Close. Close(node ast.Node, reader text.Reader, pc Context) - // CanInterruptParagraph returns true if the parser can interrupt pargraphs, + // CanInterruptParagraph returns true if the parser can interrupt paragraphs, // otherwise false. CanInterruptParagraph() bool diff --git a/renderer/html/html.go b/renderer/html/html.go index e9aca21..537a256 100644 --- a/renderer/html/html.go +++ b/renderer/html/html.go @@ -660,13 +660,13 @@ func RenderAttributes(w util.BufWriter, node ast.Node, filter util.BytesFilter) } } -// A Writer interface wirtes textual contents to a writer. +// A Writer interface writes textual contents to a writer. type Writer interface { // Write writes the given source to writer with resolving references and unescaping // backslash escaped characters. Write(writer util.BufWriter, source []byte) - // RawWrite wirtes the given source to writer without resolving references and + // RawWrite writes the given source to writer without resolving references and // unescaping backslash escaped characters. RawWrite(writer util.BufWriter, source []byte) } diff --git a/text/segment.go b/text/segment.go index 0f43fcc..badd4bc 100644 --- a/text/segment.go +++ b/text/segment.go @@ -7,7 +7,7 @@ import ( var space = []byte(" ") -// A Segment struct holds information about source potisions. +// A Segment struct holds information about source positions. type Segment struct { // Start is a start position of the segment. Start int @@ -197,7 +197,7 @@ func (s *Segments) Sliced(lo, hi int) []Segment { return s.values[lo:hi] } -// Clear delete all element of the collction. +// Clear delete all element of the collection. func (s *Segments) Clear() { s.values = nil } diff --git a/util/util.go b/util/util.go index c64a291..efc43cd 100644 --- a/util/util.go +++ b/util/util.go @@ -55,7 +55,7 @@ func (b *CopyOnWriteBuffer) IsCopied() bool { return b.copied } -// IsEscapedPunctuation returns true if caracter at a given index i +// IsEscapedPunctuation returns true if character at a given index i // is an escaped punctuation, otherwise false. func IsEscapedPunctuation(source []byte, i int) bool { return source[i] == '\\' && i < len(source)-1 && IsPunct(source[i+1]) @@ -229,7 +229,7 @@ func IndentWidth(bs []byte, currentPos int) (width, pos int) { return } -// FirstNonSpacePosition returns a potisoin line that is a first nonspace +// FirstNonSpacePosition returns a position line that is a first nonspace // character. func FirstNonSpacePosition(bs []byte) int { i := 0 @@ -589,7 +589,7 @@ var htmlSpace = []byte("%20") // 2. resolve numeric references // 3. resolve entity references // -// URL encoded values (%xx) are keeped as is. +// URL encoded values (%xx) are kept as is. func URLEscape(v []byte, resolveReference bool) []byte { if resolveReference { v = UnescapePunctuations(v)