1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
// JavaScript
/*jslint esversion: 6*/
/*global require,exports*/
"use strict";
if (typeof(require) !== 'undefined') {
var helpers = require("resource://grammalecte/graphspell/helpers.js");
}
var text = {
getParagraph: function* (sText, sSepParagraph = "\n") {
// generator: returns paragraphs of text
let iStart = 0;
let iEnd = 0;
sText = sText.replace("\r\n", "\n").replace("\r", "\n");
|
<
<
<
<
<
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
// JavaScript
/*jslint esversion: 6*/
/*global require,exports*/
"use strict";
var text = {
getParagraph: function* (sText, sSepParagraph = "\n") {
// generator: returns paragraphs of text
let iStart = 0;
let iEnd = 0;
sText = sText.replace("\r\n", "\n").replace("\r", "\n");
|
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
}
if (oErr["URL"] !== "") {
sResult += "\n > URL: " + oErr["URL"];
}
return sResult;
}
catch (e) {
helpers.logerror(e);
return "\n# Error. Data: " + oErr.toString();
}
}
};
if (typeof(exports) !== 'undefined') {
exports.getParagraph = text.getParagraph;
exports.wrap = text.wrap;
exports.getReadableError = text.getReadableError;
}
|
|
|
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
}
if (oErr["URL"] !== "") {
sResult += "\n > URL: " + oErr["URL"];
}
return sResult;
}
catch (e) {
console.error(e);
return "\n# Error. Data: " + oErr.toString();
}
}
};
if (typeof(exports) !== 'undefined') {
exports.getParagraph = text.getParagraph;
exports.wrap = text.wrap;
exports.getReadableError = text.getReadableError;
}
|