Commit 5aa47a60 authored by Michael Raskin's avatar Michael Raskin

Syncing from Monotone at 20200402-024623. Last commit message was Skip...

Syncing from Monotone at 20200402-024623. Last commit message was Skip expensive operations for huge inputs
parent 1adadad1
......@@ -33,8 +33,11 @@
(cond
((typep data '(array (unsigned-byte 8)))
(html-meta-encoding (babel:octets-to-string data :encoding :latin-1)))
; Do not try to parse a huge file which might not even be HTML
((typep data 'string)
(html-meta-encoding (html5-parser:parse-html5 data)))
(html-meta-encoding
(html5-parser:parse-html5
(subseq data 0 (min 65536 (length data))))))
(t
(ignore-errors
(content-type-encoding
......
......@@ -32,7 +32,11 @@
"")
(or
(ignore-errors
(unless skip-extract-main-content
(unless
(or
skip-extract-main-content
(> (length (current-content f)) 1048576)
)
(cl-ppcre:regex-replace-all
" *\\n *\\n"
(let ((*base-url* (current-url f)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment