Skip to content
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Here is the help message for the tool:
-page=false: Generate a standalone HTML page (implies -latex=false)
-repeat=1: Process the input multiple times (for benchmarking)
-smartypants=true: Apply smartypants-style substitutions
-spaceheaders=false: Strict handling of prefix header rules
-toc=false: Generate a table of contents (implies -latex=false)
-toconly=false: Generate a table of contents only (implies -toc)
-xhtml=true: Use XHTML-style tags in HTML output
Expand Down
9 changes: 7 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const DEFAULT_TITLE = ""

func main() {
// parse command-line options
var page, toc, toconly, xhtml, latex, smartypants, latexdashes, fractions bool
var page, toc, toconly, xhtml, latex, smartypants, latexdashes, fractions, spaceheaders bool
var css, cpuprofile string
var repeat int
flag.BoolVar(&page, "page", false,
Expand All @@ -48,6 +48,8 @@ func main() {
"Use LaTeX-style dash rules for smartypants")
flag.BoolVar(&fractions, "fractions", true,
"Use improved fraction rules for smartypants")
flag.BoolVar(&spaceheaders, "spaceheaders", false,
"Strict handling of prefix header rules")
flag.StringVar(&css, "css", "",
"Link to a CSS stylesheet (implies -page)")
flag.StringVar(&cpuprofile, "cpuprofile", "",
Expand Down Expand Up @@ -119,7 +121,10 @@ func main() {
extensions |= blackfriday.EXTENSION_FENCED_CODE
extensions |= blackfriday.EXTENSION_AUTOLINK
extensions |= blackfriday.EXTENSION_STRIKETHROUGH
extensions |= blackfriday.EXTENSION_SPACE_HEADERS

if spaceheaders {
extensions |= blackfriday.EXTENSION_SPACE_HEADERS
}

var renderer blackfriday.Renderer
if latex {
Expand Down