File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ type Options struct {
1818 PrettyTables bool // Turns on pretty ASCII rendering for table elements.
1919 PrettyTablesOptions * PrettyTablesOptions // Configures pretty ASCII rendering for table elements.
2020 OmitLinks bool // Turns on omitting links
21+ TightLinks bool // Removes whitespace around links
2122}
2223
2324// PrettyTablesOptions overrides tablewriter behaviors
@@ -255,7 +256,11 @@ func (ctx *textifyTraverseContext) handleElement(node *html.Node) error {
255256 attrVal = ctx .normalizeHrefLink (attrVal )
256257 // Don't print link href if it matches link element content or if the link is empty.
257258 if ! ctx .options .OmitLinks && attrVal != "" && linkText != attrVal {
258- hrefLink = "( " + attrVal + " )"
259+ if ctx .options .TightLinks {
260+ hrefLink = "(" + attrVal + ")"
261+ } else {
262+ hrefLink = "( " + attrVal + " )"
263+ }
259264 }
260265 }
261266
You can’t perform that action at this time.
0 commit comments