File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed
Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 44// then be further processed to HTML (provided by Blackfriday itself) or other
55// formats (provided by the community).
66//
7- // The simplest way to invoke Blackfriday is to call one of Markdown*
8- // functions. It will take a text input and produce a text output in HTML (or
9- // other format).
7+ // The simplest way to invoke Blackfriday is to call the Markdown function. It
8+ // will take a text input and produce a text output in HTML (or other format).
109//
11- // A slightly more sophisticated way to use Blackfriday is to call Parse, which
12- // returns a syntax tree for the input document. You can use that to write your
13- // own renderer or, for example, to leverage Blackfriday's parsing for content
14- // extraction from markdown documents.
10+ // A slightly more sophisticated way to use Blackfriday is to create a Processor
11+ // and to call Parse, which returns a syntax tree for the input document. You
12+ // can leverage Blackfriday's parsing for content extraction from markdown
13+ // documents. You can assign a custom renderer and set various options to the
14+ // Processor.
1515//
1616// If you're interested in calling Blackfriday from command line, see
1717// https://github.com/russross/blackfriday-tool.
Original file line number Diff line number Diff line change @@ -156,8 +156,9 @@ type Renderer interface {
156156// for each character that triggers a response when parsing inline data.
157157type inlineParser func (p * Processor , data []byte , offset int ) (int , * Node )
158158
159- // Processor holds runtime state used by the parser.
160- // This is constructed by the Markdown function.
159+ // Processor holds:
160+ // - extensions and the runtime state used by Parse,
161+ // - the renderer.
161162type Processor struct {
162163 renderer Renderer
163164 referenceOverride ReferenceOverrideFunc
@@ -254,8 +255,8 @@ type Reference struct {
254255// See the documentation in Options for more details on use-case.
255256type ReferenceOverrideFunc func (reference string ) (ref * Reference , overridden bool )
256257
257- // NewProcessor constructs a Parser . You can use the same With* functions as for
258- // Markdown() to customize parser's behavior.
258+ // NewProcessor constructs a Processor . You can use the same With* functions as
259+ // for Markdown() to customize parser's behavior.
259260func NewProcessor (opts ... Option ) * Processor {
260261 var p Processor
261262 for _ , opt := range opts {
You can’t perform that action at this time.
0 commit comments