Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing problem #48

Open
VladLeb13 opened this issue Dec 2, 2020 · 1 comment
Open

Parsing problem #48

VladLeb13 opened this issue Dec 2, 2020 · 1 comment

Comments

@VladLeb13
Copy link

Hi!
When trying to read and recognize html, a very long response occurs, the file attached

	file, err := os.Open("test.txt")
	if err != nil {
		log.Println("err", err)
	}
	b, err := ioutil.ReadAll(file)
	if err != nil {
		log.Printf("Got text error: %+v\n", err)
	}
	str := bytes.NewBuffer(b).String()
	text, err := html2text.FromString(str, html2text.Options{PrettyTables: true})
	if err != nil {
		log.Println(err)
	}
	log.Println(text)

test.txt

@ros-tel
Copy link

ros-tel commented Dec 21, 2020

Try this

...
	prettyTablesOptions := html2text.NewPrettyTablesOptions()
	prettyTablesOptions.AutoWrapText = false
	text, err := html2text.FromString(str, html2text.Options{PrettyTables: true, PrettyTablesOptions: prettyTablesOptions})
...

aviator-app bot pushed a commit to alcionai/corso that referenced this issue Feb 23, 2024
…5244)

Related: jaytaylor/html2text#48<!-- PR description-->

---

#### Does this PR need a docs update or release note?

- [x] ✅ Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [ ] ⛔ No

#### Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [x] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

#### Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* #<issue>

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [ ] ⚡ Unit test
- [ ] 💚 E2E
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants