mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
🎨 Limit memory usage of PDF parsing https://github.com/siyuan-note/siyuan/pull/9051
This commit is contained in:
@@ -861,12 +861,12 @@ func (parser *PdfAssetParser) Parse(absPath string) (ret *AssetParseResult) {
|
||||
}
|
||||
|
||||
// loop through ordered PDF text pages and join content for asset parse DB result
|
||||
content := ""
|
||||
contentBuilder := bytes.Buffer{}
|
||||
for _, pt := range pageText {
|
||||
content += " " + normalizeNonTxtAssetContent(pt)
|
||||
contentBuilder.WriteString(" " + normalizeNonTxtAssetContent(pt))
|
||||
}
|
||||
ret = &AssetParseResult{
|
||||
Content: content,
|
||||
Content: contentBuilder.String(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user