mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
documentation typo fixes
This commit is contained in:
parent
0b49730177
commit
8bdab9449a
11 changed files with 23 additions and 23 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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{
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue