diff options
author | Benjamin <b.mpickford@outlook.com> | 2019-11-18 06:18:01 +1000 |
---|---|---|
committer | Wim <wim@42.be> | 2019-11-17 21:18:01 +0100 |
commit | 0917dc876613fd71c9726a34bf0138b4f5121be9 (patch) | |
tree | 1eacaadaa4869e8f74ccf65c684c2a80f90787f9 /vendor/github.com/gomarkdown/markdown/changes-from-blackfriday.md | |
parent | aba86855b5f71c9809d892a7eebc6b69872fcd5b (diff) | |
download | matterbridge-msglm-0917dc876613fd71c9726a34bf0138b4f5121be9.tar.gz matterbridge-msglm-0917dc876613fd71c9726a34bf0138b4f5121be9.tar.bz2 matterbridge-msglm-0917dc876613fd71c9726a34bf0138b4f5121be9.zip |
Update markdown parsing library to github.com/gomarkdown/markdown (#944)
Diffstat (limited to 'vendor/github.com/gomarkdown/markdown/changes-from-blackfriday.md')
-rw-r--r-- | vendor/github.com/gomarkdown/markdown/changes-from-blackfriday.md | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/vendor/github.com/gomarkdown/markdown/changes-from-blackfriday.md b/vendor/github.com/gomarkdown/markdown/changes-from-blackfriday.md new file mode 100644 index 00000000..b618dfef --- /dev/null +++ b/vendor/github.com/gomarkdown/markdown/changes-from-blackfriday.md @@ -0,0 +1,27 @@ +## Changes from blackfriday + +This library is derived from blackfriday library. Here's a list of changes. + +**Redesigned API** + +- split into 3 separate packages: ast, parser and html (for html renderer). This makes the API more manageable. It also separates e.g. parser option from renderer options +- changed how AST node is represented from union-like representation (manually keeping track of the type of the node) to using interface{} (which is a Go way to combine an arbitrary value with its type) + +**Allow re-using most of html renderer logic** + +You can implement your own renderer by implementing `Renderer` interface. + +Implementing a full renderer is a lot of work and often you just want to tweak html rendering of few node typs. + +I've added a way to hook `Renderer.Render` function in html renderer with a custom function that can take over rendering of specific nodes. + +I use it myself to do syntax-highlighting of code snippets. + +**Speed up go test** + +Running `go test` was really slow (17 secs) because it did a poor man's version of fuzzing by feeding the parser all subsets of test strings in order to find panics +due to incorrect parsing logic. + +I've moved that logic to `cmd/crashtest`, so that it can be run on CI but not slow down regular development. + +Now `go test` is blazing fast. |