Refactor parser code (#9042)

### What problem does this PR solve?

Refactor code

### Type of change

- [x] Refactoring

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2025-07-25 12:04:07 +08:00
committed by GitHub
parent bcaac061ac
commit 03daf4618c
3 changed files with 7 additions and 7 deletions

View File

@ -41,7 +41,7 @@ class RAGFlowHtmlParser:
@classmethod
def parser_txt(cls, txt):
if not isinstance(txt, str):
raise TypeError("txt type should be str!")
raise TypeError("txt type should be string!")
html_doc = readability.Document(txt)
title = html_doc.title()
content = html_text.extract_text(html_doc.summary(html_partial=True))