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

chore: replace document plain text with paragraphs #361

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Horusiath
Copy link
Collaborator

@Horusiath Horusiath commented Jan 2, 2025

This PR replaces Document::to_plain_text with Document::paragraphs returning blocks as plain text paragraph list, which is more versatile option:

  1. We can group paragraphs together: for the purpose of future text chunking for the appflowy-cloud document indexer.
  2. new_line_each_paragraph parameter is not necessary: just use Document::paragraphs().join("\n") if necessary.
  3. empty_space_each_delta parameter is also not necessary: current logic trims the preceding and leading whitespaces but only adds extra spaces only if we actually trimmed the content.

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