Rename HtmlFlags to HTMLFlags to adhere to Go style

This commit is contained in:
Vytautas Šaltenis 2016-04-01 10:49:23 +03:00
parent 71fe9a191e
commit 2a07386455
3 changed files with 11 additions and 11 deletions

16
html.go
View File

@ -25,12 +25,12 @@ import (
"strings" "strings"
) )
type HtmlFlags int type HTMLFlags int
// HTML renderer configuration options. // HTML renderer configuration options.
const ( const (
HtmlFlagsNone HtmlFlags = 0 HTMLFlagsNone HTMLFlags = 0
SkipHTML HtmlFlags = 1 << iota // Skip preformatted HTML blocks SkipHTML HTMLFlags = 1 << iota // Skip preformatted HTML blocks
SkipStyle // Skip embedded <style> elements SkipStyle // Skip embedded <style> elements
SkipImages // Skip embedded images SkipImages // Skip embedded images
SkipLinks // Skip all links SkipLinks // Skip all links
@ -88,7 +88,7 @@ type HtmlRendererParameters struct {
// //
// Do not create this directly, instead use the HtmlRenderer function. // Do not create this directly, instead use the HtmlRenderer function.
type HTML struct { type HTML struct {
flags HtmlFlags flags HTMLFlags
closeTag string // how to end singleton tags: either " />" or ">" closeTag string // how to end singleton tags: either " />" or ">"
title string // document title title string // document title
css string // optional css file url (used with HTML_COMPLETE_PAGE) css string // optional css file url (used with HTML_COMPLETE_PAGE)
@ -119,11 +119,11 @@ const (
// HtmlRenderer creates and configures an HTML object, which // HtmlRenderer creates and configures an HTML object, which
// satisfies the Renderer interface. // satisfies the Renderer interface.
// //
// flags is a set of HtmlFlags ORed together. // flags is a set of HTMLFlags ORed together.
// title is the title of the document, and css is a URL for the document's // title is the title of the document, and css is a URL for the document's
// stylesheet. // stylesheet.
// title and css are only used when HTML_COMPLETE_PAGE is selected. // title and css are only used when HTML_COMPLETE_PAGE is selected.
func HtmlRenderer(flags HtmlFlags, extensions Extensions, title string, css string) Renderer { func HtmlRenderer(flags HTMLFlags, extensions Extensions, title string, css string) Renderer {
return HtmlRendererWithParameters(flags, extensions, title, css, HtmlRendererParameters{}) return HtmlRendererWithParameters(flags, extensions, title, css, HtmlRendererParameters{})
} }
@ -153,7 +153,7 @@ func (r *HTML) Write(b []byte) (int, error) {
return r.w.Write(b) return r.w.Write(b)
} }
func HtmlRendererWithParameters(flags HtmlFlags, extensions Extensions, title string, func HtmlRendererWithParameters(flags HTMLFlags, extensions Extensions, title string,
css string, renderParameters HtmlRendererParameters) Renderer { css string, renderParameters HtmlRendererParameters) Renderer {
// configure the rendering engine // configure the rendering engine
closeTag := htmlClose closeTag := htmlClose
@ -976,7 +976,7 @@ func (r *HTML) addAbsPrefix(link []byte) []byte {
return link return link
} }
func appendLinkAttrs(attrs []string, flags HtmlFlags, link []byte) []string { func appendLinkAttrs(attrs []string, flags HTMLFlags, link []byte) []string {
if isRelativeLink(link) { if isRelativeLink(link) {
return attrs return attrs
} }

View File

@ -20,7 +20,7 @@ import (
"strings" "strings"
) )
func runMarkdownInline(input string, opts Options, htmlFlags HtmlFlags, params HtmlRendererParameters) string { func runMarkdownInline(input string, opts Options, htmlFlags HTMLFlags, params HtmlRendererParameters) string {
opts.Extensions |= Autolink opts.Extensions |= Autolink
opts.Extensions |= Strikethrough opts.Extensions |= Strikethrough
@ -56,7 +56,7 @@ func doSafeTestsInline(t *testing.T, tests []string) {
doTestsInlineParam(t, transformTests, Options{}, Safelink, params) doTestsInlineParam(t, transformTests, Options{}, Safelink, params)
} }
func doTestsInlineParam(t *testing.T, tests []string, opts Options, htmlFlags HtmlFlags, func doTestsInlineParam(t *testing.T, tests []string, opts Options, htmlFlags HTMLFlags,
params HtmlRendererParameters) { params HtmlRendererParameters) {
// catch and report panics // catch and report panics
var candidate string var candidate string

View File

@ -55,7 +55,7 @@ const (
SmartypantsLatexDashes // Enable LaTeX-style dashes (with Smartypants) SmartypantsLatexDashes // Enable LaTeX-style dashes (with Smartypants)
SmartypantsAngledQuotes // Enable angled double quotes (with Smartypants) for double quotes rendering SmartypantsAngledQuotes // Enable angled double quotes (with Smartypants) for double quotes rendering
CommonHtmlFlags HtmlFlags = UseXHTML CommonHtmlFlags HTMLFlags = UseXHTML
CommonExtensions Extensions = NoIntraEmphasis | Tables | FencedCode | CommonExtensions Extensions = NoIntraEmphasis | Tables | FencedCode |
Autolink | Strikethrough | SpaceHeaders | HeaderIDs | Autolink | Strikethrough | SpaceHeaders | HeaderIDs |