Skip to content

Conversation

sigoden
Copy link
Owner

@sigoden sigoden commented Sep 6, 2024

Previously, we used the html2text crate, but now we have switched to html_to_markdown crate.

Here is the reason:

  • html2text::from_read(html, wrap_width) requires a wrap_width, but for RAG, a larger wrap width is better. However, using usize::MAX can cause issues, as it may result in the generated markdown file being excessively large due to html2text automatically inserting spaces for wrap_width.
  • html_to_markdown::convert_html_to_markdown allows us to control how each type of element is converted. For example, ignore <img>, <video> tags.

@sigoden sigoden merged commit 555f4f5 into main Sep 6, 2024
3 checks passed
@sigoden sigoden deleted the feat branch September 6, 2024 00:08
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

Successfully merging this pull request may close these issues.

1 participant