Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

Commit

Permalink
Small fixes and gofmt -s -w
Browse files Browse the repository at this point in the history
  • Loading branch information
miekg committed May 6, 2016
1 parent 19758d6 commit 2f14c16
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 46 deletions.
7 changes: 3 additions & 4 deletions block.go
Original file line number Diff line number Diff line change
Expand Up @@ -1849,9 +1849,9 @@ func (p *parser) uliPrefix(data []byte) int {
for i < 3 && data[i] == ' ' {
i++
}

// need a *, +, #, or - followed by a space
if (data[i] != '*' && data[i] != '+' && data[i] != '-' && data[i] != ' ') || data[i+1] != ' ' {
// need a *, +, or - followed by a space
if (data[i] != '*' && data[i] != '+' && data[i] != '-') ||
data[i+1] != ' ' {
return 0
}
return i + 2
Expand Down Expand Up @@ -2225,7 +2225,6 @@ gatherlines:
}
break gatherlines


// a blank line means this should be parsed as a block
case containsBlankLine:
*flags |= _LIST_ITEM_CONTAINS_BLOCK
Expand Down
2 changes: 1 addition & 1 deletion html.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ func (options *html) BlockCode(out *bytes.Buffer, text []byte, lang string, capt
ial := options.Attr()

prefix := ial.Value("prefix")
ial.DropAttr("prefix") // it's a fake attribute, so drop it, works on text bytes
ial.DropAttr("prefix") // it's a fake attribute, so drop it, works on text bytes

s := options.AttrString(ial)

Expand Down
70 changes: 35 additions & 35 deletions markdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,43 +125,43 @@ const (
// blockTags is a set of tags that are recognized as HTML block tags.
// Any of these can be included in markdown text without special escaping.
var blockTags = map[string]struct{}{
"blockquote": struct{}{},
"del": struct{}{},
"div": struct{}{},
"dl": struct{}{},
"fieldset": struct{}{},
"form": struct{}{},
"h1": struct{}{},
"h2": struct{}{},
"h3": struct{}{},
"h4": struct{}{},
"h5": struct{}{},
"h6": struct{}{},
"iframe": struct{}{},
"ins": struct{}{},
"math": struct{}{},
"noscript": struct{}{},
"ol": struct{}{},
"pre": struct{}{},
"p": struct{}{},
"script": struct{}{},
"style": struct{}{},
"table": struct{}{},
"ul": struct{}{},
"blockquote": {},
"del": {},
"div": {},
"dl": {},
"fieldset": {},
"form": {},
"h1": {},
"h2": {},
"h3": {},
"h4": {},
"h5": {},
"h6": {},
"iframe": {},
"ins": {},
"math": {},
"noscript": {},
"ol": {},
"pre": {},
"p": {},
"script": {},
"style": {},
"table": {},
"ul": {},

// HTML5
"article": struct{}{},
"aside": struct{}{},
"canvas": struct{}{},
"figcaption": struct{}{},
"figure": struct{}{},
"footer": struct{}{},
"header": struct{}{},
"hgroup": struct{}{},
"output": struct{}{},
"progress": struct{}{},
"section": struct{}{},
"video": struct{}{},
"article": {},
"aside": {},
"canvas": {},
"figcaption": {},
"figure": {},
"footer": {},
"header": {},
"hgroup": {},
"output": {},
"progress": {},
"section": {},
"video": {},
}

// Renderer is the rendering interface.
Expand Down
4 changes: 2 additions & 2 deletions rfc7328.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ func (p *parser) rfc7328Index(out *bytes.Buffer, text []byte) int {

subItemStart := i
if subItemStart != len(text) {
printf(p, "rfc 7328 style index parsed to: ((%s, %s))", string(text[1:itemEnd]), text[subItemStart:len(text)])
p.r.Index(out, text[1:itemEnd], text[subItemStart:len(text)], false)
printf(p, "rfc 7328 style index parsed to: ((%s, %s))", string(text[1:itemEnd]), text[subItemStart:])
p.r.Index(out, text[1:itemEnd], text[subItemStart:], false)
return len(text)
}
printf(p, "rfc 7328 style index parsed to: ((%s))", string(text[1:itemEnd]))
Expand Down
8 changes: 4 additions & 4 deletions toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ type addressPostal struct {
PostalLine []string

// Plurals when these need to be specified multiple times.
Streets []string
Cities []string
Codes []string
Streets []string
Cities []string
Codes []string
Countries []string
Regions []string
Regions []string
}

// PIs the processing instructions.
Expand Down

0 comments on commit 2f14c16

Please sign in to comment.