set a limit on the number of lines used for detect in Bookmarks.js, so that it doesn't break large file import
at some point, this should probably be changed to read a fixed number of bytes
This commit is contained in:
parent
ae1e82494d
commit
d8ecaec6e4
1 changed files with 4 additions and 2 deletions
|
@ -8,7 +8,7 @@
|
||||||
"maxVersion":"",
|
"maxVersion":"",
|
||||||
"priority":100,
|
"priority":100,
|
||||||
"inRepository":true,
|
"inRepository":true,
|
||||||
"lastUpdated":"2011-02-10 04:31:00"
|
"lastUpdated":"2011-03-16 23:24:54"
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -48,13 +48,15 @@
|
||||||
</DL>
|
</DL>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const MAX_DETECT_LINES = 150;
|
||||||
|
|
||||||
function detectImport() {
|
function detectImport() {
|
||||||
var text = "";
|
var text = "";
|
||||||
var line;
|
var line;
|
||||||
var match;
|
var match;
|
||||||
var re = /<DT>\s*<A[^>]*HREF="([^"]+)"[^>]*>([^<\n]+)/gi;
|
var re = /<DT>\s*<A[^>]*HREF="([^"]+)"[^>]*>([^<\n]+)/gi;
|
||||||
while((line = Zotero.read()) !== false) {
|
var i = 0;
|
||||||
|
while((line = Zotero.read()) !== false && (i++ < MAX_DETECT_LINES)) {
|
||||||
text += line;
|
text += line;
|
||||||
match = re.exec(text);
|
match = re.exec(text);
|
||||||
if (match) {
|
if (match) {
|
||||||
|
|
Loading…
Reference in a new issue