mirror of
https://github.com/russross/blackfriday.git
synced 2024-03-22 13:40:34 +08:00
Rename HtmlFlags to HTMLFlags to adhere to Go style
This commit is contained in:
parent
71fe9a191e
commit
2a07386455
16
html.go
16
html.go
|
@ -25,12 +25,12 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
type HtmlFlags int
|
||||
type HTMLFlags int
|
||||
|
||||
// HTML renderer configuration options.
|
||||
const (
|
||||
HtmlFlagsNone HtmlFlags = 0
|
||||
SkipHTML HtmlFlags = 1 << iota // Skip preformatted HTML blocks
|
||||
HTMLFlagsNone HTMLFlags = 0
|
||||
SkipHTML HTMLFlags = 1 << iota // Skip preformatted HTML blocks
|
||||
SkipStyle // Skip embedded <style> elements
|
||||
SkipImages // Skip embedded images
|
||||
SkipLinks // Skip all links
|
||||
|
@ -88,7 +88,7 @@ type HtmlRendererParameters struct {
|
|||
//
|
||||
// Do not create this directly, instead use the HtmlRenderer function.
|
||||
type HTML struct {
|
||||
flags HtmlFlags
|
||||
flags HTMLFlags
|
||||
closeTag string // how to end singleton tags: either " />" or ">"
|
||||
title string // document title
|
||||
css string // optional css file url (used with HTML_COMPLETE_PAGE)
|
||||
|
@ -119,11 +119,11 @@ const (
|
|||
// HtmlRenderer creates and configures an HTML object, which
|
||||
// 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
|
||||
// stylesheet.
|
||||
// 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{})
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ func (r *HTML) Write(b []byte) (int, error) {
|
|||
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 {
|
||||
// configure the rendering engine
|
||||
closeTag := htmlClose
|
||||
|
@ -976,7 +976,7 @@ func (r *HTML) addAbsPrefix(link []byte) []byte {
|
|||
return link
|
||||
}
|
||||
|
||||
func appendLinkAttrs(attrs []string, flags HtmlFlags, link []byte) []string {
|
||||
func appendLinkAttrs(attrs []string, flags HTMLFlags, link []byte) []string {
|
||||
if isRelativeLink(link) {
|
||||
return attrs
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ import (
|
|||
"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 |= Strikethrough
|
||||
|
||||
|
@ -56,7 +56,7 @@ func doSafeTestsInline(t *testing.T, tests []string) {
|
|||
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) {
|
||||
// catch and report panics
|
||||
var candidate string
|
||||
|
|
|
@ -55,7 +55,7 @@ const (
|
|||
SmartypantsLatexDashes // Enable LaTeX-style dashes (with Smartypants)
|
||||
SmartypantsAngledQuotes // Enable angled double quotes (with Smartypants) for double quotes rendering
|
||||
|
||||
CommonHtmlFlags HtmlFlags = UseXHTML
|
||||
CommonHtmlFlags HTMLFlags = UseXHTML
|
||||
|
||||
CommonExtensions Extensions = NoIntraEmphasis | Tables | FencedCode |
|
||||
Autolink | Strikethrough | SpaceHeaders | HeaderIDs |
|
||||
|
|
Loading…
Reference in New Issue
Block a user