Skip to content

Panics when parsing https://twitter.com/RedTeamPT/status/1110843396657238016 #35

@malisetti

Description

@malisetti

using these two options

html2text.Options{OmitLinks: true}
html2text.Options{PrettyTables: true}

Update:

when using the prettytables option as false, wont panic.

Error:

panic: runtime error: index out of range

goroutine 154 [running]:
github.com/olekukonko/tablewriter.(*Table).printFooter(0xc000578c00)
/home/seshachalamm/go/pkg/mod/github.com/olekukonko/[email protected]/table.go:477 +0xd73
github.com/olekukonko/tablewriter.(*Table).Render(0xc000578c00)
/home/seshachalamm/go/pkg/mod/github.com/olekukonko/[email protected]/table.go:135 +0x93
jaytaylor.com/html2text.(*textifyTraverseContext).handleTableElement(0xc000146000, 0xc000626e70, 0xa, 0x2)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:347 +0x7b8
jaytaylor.com/html2text.(*textifyTraverseContext).handleElement(0xc000146000, 0xc000626e70, 0x0, 0x0)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:269 +0x5e7
jaytaylor.com/html2text.(*textifyTraverseContext).traverse(0xc000146000, 0xc000626e70, 0x0, 0x0)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:407 +0x10e
jaytaylor.com/html2text.(*textifyTraverseContext).traverseChildren(0xc000146000, 0xc000626d90, 0x7, 0x2)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:413 +0x4e
jaytaylor.com/html2text.(*textifyTraverseContext).handleElement(0xc000146000, 0xc000626d90, 0x0, 0x0)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:205 +0xb8d
jaytaylor.com/html2text.(*textifyTraverseContext).traverse(0xc000146000, 0xc000626d90, 0x0, 0x0)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:407 +0x10e
jaytaylor.com/html2text.(*textifyTraverseContext).traverseChildren(0xc000146000, 0xc000626620, 0x0, 0x2)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:413 +0x4e
jaytaylor.com/html2text.(*textifyTraverseContext).handleElement(0xc000146000, 0xc000626620, 0x0, 0x0)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:205 +0xb8d
jaytaylor.com/html2text.(*textifyTraverseContext).traverse(0xc000146000, 0xc000626620, 0x0, 0x0)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:407 +0x10e
jaytaylor.com/html2text.(*textifyTraverseContext).traverseChildren(0xc000146000, 0xc000626540, 0x3, 0x2)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:413 +0x4e
jaytaylor.com/html2text.(*textifyTraverseContext).handleElement(0xc000146000, 0xc000626540, 0x0, 0x0)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:205 +0xb8d
jaytaylor.com/html2text.(*textifyTraverseContext).traverse(0xc000146000, 0xc000626540, 0x0, 0x0)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:407 +0x10e
jaytaylor.com/html2text.(*textifyTraverseContext).traverseChildren(0xc000146000, 0xc000626460, 0x4, 0x2)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:413 +0x4e
jaytaylor.com/html2text.(*textifyTraverseContext).handleElement(0xc000146000, 0xc000626460, 0x0, 0x0)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:205 +0xb8d
jaytaylor.com/html2text.(*textifyTraverseContext).traverse(0xc000146000, 0xc000626460, 0x0, 0x0)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:407 +0x10e
jaytaylor.com/html2text.(*textifyTraverseContext).traverseChildren(0xc000146000, 0xc0001cb0a0, 0x1, 0x1000000000002)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:413 +0x4e
jaytaylor.com/html2text.(*textifyTraverseContext).handleElement(0xc000146000, 0xc0001cb0a0, 0x0, 0x0)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:286 +0x4d3
jaytaylor.com/html2text.(*textifyTraverseContext).traverse(0xc000146000, 0xc0001cb0a0, 0x0, 0x0)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:407 +0x10e
jaytaylor.com/html2text.(*textifyTraverseContext).traverseChildren(0xc000146000, 0xc000138540, 0x1, 0x1)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:413 +0x4e
jaytaylor.com/html2text.(*textifyTraverseContext).handleElement(0xc000146000, 0xc000138540, 0x0, 0x0)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:286 +0x4d3
jaytaylor.com/html2text.(*textifyTraverseContext).traverse(0xc000146000, 0xc000138540, 0x0, 0x0)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:407 +0x10e
jaytaylor.com/html2text.(*textifyTraverseContext).traverseChildren(0xc000146000, 0xc0001383f0, 0x4108a8, 0x120)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:413 +0x4e
jaytaylor.com/html2text.(*textifyTraverseContext).traverse(0xc000146000, 0xc0001383f0, 0x1, 0xc00058e2a0)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:395 +0x13f
jaytaylor.com/html2text.FromHTMLNode(0xc0001383f0, 0xc0004abf80, 0x2, 0x2, 0x0, 0x0, 0x0, 0x7f9a58c56740)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:76 +0x10d
jaytaylor.com/html2text.FromReader(0x7f9a58c56740, 0xc0005f6900, 0xc0004abf80, 0x2, 0x2, 0xc000bcc001, 0x3c65, 0x0, 0x0)
/home/seshachalamm/go/pkg/mod/jaytaylor.com/[email protected]/html2text.go:97 +0xc1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions