@promptbook/markdown-utils 0.74.0-7 → 0.74.0-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/index.es.js +7 -5
- package/esm/index.es.js.map +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +7 -5
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -20,7 +20,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
20
20
|
*
|
|
21
21
|
* @see https://github.com/webgptorg/promptbook
|
|
22
22
|
*/
|
|
23
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.74.0-
|
|
23
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.74.0-7';
|
|
24
24
|
/**
|
|
25
25
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
26
26
|
*/
|
|
@@ -4281,10 +4281,12 @@ function countLines(text) {
|
|
|
4281
4281
|
* @public exported from `@promptbook/utils`
|
|
4282
4282
|
*/
|
|
4283
4283
|
function countPages(text) {
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4284
|
+
if (text === '') {
|
|
4285
|
+
return 0;
|
|
4286
|
+
}
|
|
4287
|
+
var pagesByLinesCount = Math.ceil(countLines(text) / 44);
|
|
4288
|
+
var pagesByCharactersCount = Math.ceil(countCharacters(text) / 2772);
|
|
4289
|
+
return Math.max(pagesByLinesCount, pagesByCharactersCount);
|
|
4288
4290
|
}
|
|
4289
4291
|
|
|
4290
4292
|
/**
|