Skip to content

Commit

Permalink
Don't require --html to write styles.
Browse files Browse the repository at this point in the history
See #139.
  • Loading branch information
alecthomas committed Apr 20, 2018
1 parent 33cc533 commit 222a1f0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cmd/chroma/main.go
Expand Up @@ -124,6 +124,13 @@ command, for Go.
style, err := builder.Build()
kingpin.FatalIfError(err, "")

// Dump styles.
if *htmlStylesFlag {
formatter := html.New(html.WithClasses())
formatter.WriteCSS(w, style)
return
}

if *formatterFlag == "html" {
options := []html.Option{
html.TabWidth(*htmlTabWidthFlag),
Expand All @@ -132,13 +139,6 @@ command, for Go.
if *htmlPrefixFlag != "" {
options = append(options, html.ClassPrefix(*htmlPrefixFlag))
}

// Dump styles.
if *htmlStylesFlag {
formatter := html.New(html.WithClasses())
formatter.WriteCSS(w, style)
return
}
if !*htmlInlineStyleFlag {
options = append(options, html.WithClasses())
}
Expand Down

0 comments on commit 222a1f0

Please sign in to comment.