From ec5223154f3274136b63f993eb5444193e41174e Mon Sep 17 00:00:00 2001 From: jypelle <52546084+jypelle@users.noreply.github.com> Date: Thu, 26 Dec 2019 12:09:27 +0100 Subject: [PATCH] Add NoStrongs option --- html2text.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/html2text.go b/html2text.go index 4398909..2a25a52 100644 --- a/html2text.go +++ b/html2text.go @@ -18,6 +18,7 @@ type Options struct { PrettyTables bool // Turns on pretty ASCII rendering for table elements. PrettyTablesOptions *PrettyTablesOptions // Configures pretty ASCII rendering for table elements. OmitLinks bool // Turns on omitting links + NoStrongs bool // Turns on no strongs } // PrettyTablesOptions overrides tablewriter behaviors @@ -230,6 +231,9 @@ func (ctx *textifyTraverseContext) handleElement(node *html.Node) error { return err } str := subCtx.buf.String() + if ctx.options.NoStrongs { + return ctx.emit(str) + } return ctx.emit("*" + str + "*") case atom.A: