Skip to content

Commit 257ccba

Browse files
committed
Catch up README with the latest changes in code
1 parent 70c446a commit 257ccba

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

README.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,22 @@ Potential drawbacks:
5252
ballpark of around 15%.
5353
* API breakage. If you can't afford modifying your code to adhere to the new API
5454
and don't care too much about the new features, v2 is probably not for you.
55-
55+
* Some bug fixes are trailing behind and still need to be forward-ported to v2.
56+
See issue #348 for tracking.
5657

5758
Usage
5859
-----
5960

60-
For basic usage, it is as simple as getting your input into a byte
61-
slice and calling:
61+
For the most sensible markdown processing, it is as simple as getting your input
62+
into a byte slice and calling:
6263

63-
output := blackfriday.MarkdownBasic(input)
64+
output := blackfriday.Run(input)
6465

65-
This renders it with no extensions enabled. To get a more useful
66-
feature set, use this instead:
66+
Your input will be parsed and the output rendered with a set of most popular
67+
extensions enabled. If you want the most basic feature set, corresponding with
68+
the bare Markdown specification, use:
6769

68-
output := blackfriday.MarkdownCommon(input)
70+
output := blackfriday.Run(input, blackfriday.WithNoExtensions())
6971

7072
### Sanitize untrusted content
7173

@@ -82,17 +84,14 @@ import (
8284
)
8385

8486
// ...
85-
unsafe := blackfriday.MarkdownCommon(input)
87+
unsafe := blackfriday.Run(input)
8688
html := bluemonday.UGCPolicy().SanitizeBytes(unsafe)
8789
```
8890

8991
### Custom options
9092

91-
If you want to customize the set of options, first get a renderer
92-
(currently only the HTML output engine), then use it to
93-
call the more general `Markdown` function. For examples, see the
94-
implementations of `MarkdownBasic` and `MarkdownCommon` in
95-
`markdown.go`.
93+
If you want to customize the set of options, use `blackfriday.WithExtensions`,
94+
`blackfriday.WithRenderer` and `blackfriday.WithRefOverride`.
9695

9796
You can also check out `blackfriday-tool` for a more complete example
9897
of how to use it. Download and install it using:
@@ -214,10 +213,8 @@ implements the following extensions:
214213
* **Strikethrough**. Use two tildes (`~~`) to mark text that
215214
should be crossed out.
216215
217-
* **Hard line breaks**. With this extension enabled (it is off by
218-
default in the `MarkdownBasic` and `MarkdownCommon` convenience
219-
functions), newlines in the input translate into line breaks in
220-
the output.
216+
* **Hard line breaks**. With this extension enabled newlines in the input
217+
translate into line breaks in the output. This extension is off by default.
221218
222219
* **Smart quotes**. Smartypants-style punctuation substitution is
223220
supported, turning normal double- and single-quote marks into

0 commit comments

Comments
 (0)