Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rename: Options -> Extensions

  • Loading branch information...
commit 2b2e21d8c55b71146eaf88b54561e921778e8d8c 1 parent 7799c9c
@knieriem authored
Showing with 8 additions and 8 deletions.
  1. +1 −1  cmd/markdown/main.go
  2. +1 −1  doc.go
  3. +5 −5 markdown.go
  4. +1 −1  parser.leg
View
2  cmd/markdown/main.go
@@ -10,7 +10,7 @@ import (
)
func main() {
- var opt markdown.Options
+ var opt markdown.Extensions
flag.BoolVar(&opt.Notes, "notes", false, "turn on footnote syntax")
flag.BoolVar(&opt.Smart, "smart", false, "turn on smart quotes, dashes, and ellipses")
flag.BoolVar(&opt.Dlists, "dlists", false, "support definitions lists")
View
2  doc.go
@@ -12,7 +12,7 @@ Usage example:
)
func main() {
- p := markdown.NewParser(&markdown.Options{Smart: true})
+ p := markdown.NewParser(&markdown.Extensions{Smart: true})
w := bufio.NewWriter(os.Stdout)
p.Markdown(os.Stdin, markdown.ToHTML(w))
View
10 markdown.go
@@ -34,8 +34,8 @@ const (
needParserIfaceVersion = parserIfaceVersion_16
)
-// Markdown Options:
-type Options struct {
+// Markdown Extensions.
+type Extensions struct {
Smart bool
Notes bool
FilterHTML bool
@@ -51,10 +51,10 @@ type Parser struct {
// NewParser creates an instance of a parser. It can be reused
// so that stacks and buffers need not be allocated anew for
// each Markdown call.
-func NewParser(opt *Options) (p *Parser) {
+func NewParser(x *Extensions) (p *Parser) {
p = new(Parser)
- if opt != nil {
- p.yy.state.extension = *opt
+ if x != nil {
+ p.yy.state.extension = *x
}
p.yy.Init()
p.yy.state.heap.init(1024)
View
2  parser.leg
@@ -95,7 +95,7 @@ const (
)
type state struct {
- extension Options
+ extension Extensions
heap elemHeap
tree *element /* Results of parse. */
references *element /* List of link references found. */
Please sign in to comment.
Something went wrong with that request. Please try again.