summaryrefslogtreecommitdiffstats
path: root/bridge/telegram/html.go
diff options
context:
space:
mode:
authorDuco van Amstel <duco.vanamstel@gmail.com>2018-10-22 10:48:29 -0700
committerWim <wim@42.be>2018-10-22 19:48:29 +0200
commitf2cdda7278e01b548f8aff6567376ae2f15c1803 (patch)
treece6edbde50dc721b366e97e43c2726df808b59f8 /bridge/telegram/html.go
parent6911458d15f548070da870cc7f68c2a882f1c674 (diff)
downloadmatterbridge-msglm-f2cdda7278e01b548f8aff6567376ae2f15c1803.tar.gz
matterbridge-msglm-f2cdda7278e01b548f8aff6567376ae2f15c1803.tar.bz2
matterbridge-msglm-f2cdda7278e01b548f8aff6567376ae2f15c1803.zip
Update Blackfriday dependency (closes #522) (#532)
- Fixup Telegram bridge implementation to support updated dependency.
Diffstat (limited to 'bridge/telegram/html.go')
-rw-r--r--bridge/telegram/html.go21
1 files changed, 12 insertions, 9 deletions
diff --git a/bridge/telegram/html.go b/bridge/telegram/html.go
index 85547d7b..35b3f4f9 100644
--- a/bridge/telegram/html.go
+++ b/bridge/telegram/html.go
@@ -53,13 +53,16 @@ func (options *customHTML) ListItem(out *bytes.Buffer, text []byte, flags int) {
}
func makeHTML(input string) string {
- return string(blackfriday.Markdown([]byte(input),
- &customHTML{blackfriday.HtmlRenderer(blackfriday.HTML_USE_XHTML|blackfriday.HTML_SKIP_IMAGES, "", "")},
- blackfriday.EXTENSION_NO_INTRA_EMPHASIS|
- blackfriday.EXTENSION_FENCED_CODE|
- blackfriday.EXTENSION_AUTOLINK|
- blackfriday.EXTENSION_SPACE_HEADERS|
- blackfriday.EXTENSION_HEADER_IDS|
- blackfriday.EXTENSION_BACKSLASH_LINE_BREAK|
- blackfriday.EXTENSION_DEFINITION_LISTS))
+ extensions := blackfriday.NoIntraEmphasis |
+ blackfriday.FencedCode |
+ blackfriday.Autolink |
+ blackfriday.SpaceHeadings |
+ blackfriday.HeadingIDs |
+ blackfriday.BackslashLineBreak |
+ blackfriday.DefinitionLists
+
+ renderer := &customHTML{blackfriday.NewHTMLRenderer(blackfriday.HTMLRendererParameters{
+ Flags: blackfriday.UseXHTML | blackfriday.SkipImages,
+ })}
+ return string(blackfriday.Run([]byte(input), blackfriday.WithExtensions(extensions), blackfriday.WithRenderer(renderer)))
}