markwell 0.1.4 → 0.1.5
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/dist/cli/index.js +4 -4
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -316,7 +316,7 @@ function parseVttTimestamp(line) {
|
|
|
316
316
|
};
|
|
317
317
|
}
|
|
318
318
|
function parseVttContent(content) {
|
|
319
|
-
const lines = content.split("\n");
|
|
319
|
+
const lines = content.replace(/\r\n/g, "\n").split("\n");
|
|
320
320
|
const cues = [];
|
|
321
321
|
let i = 0;
|
|
322
322
|
while (i < lines.length && !lines[i].includes("-->")) i++;
|
|
@@ -385,7 +385,7 @@ const vttIngest = {
|
|
|
385
385
|
* sequential number, then timestamp line with -->
|
|
386
386
|
*/
|
|
387
387
|
function isSrtFormat(head) {
|
|
388
|
-
const lines = head.trim().split("\n");
|
|
388
|
+
const lines = head.trim().replace(/\r\n/g, "\n").split("\n");
|
|
389
389
|
if (lines.length < 2) return false;
|
|
390
390
|
if (!/^\d+$/.test(lines[0].trim())) return false;
|
|
391
391
|
return /\d{2}:\d{2}:\d{2},\d{3}\s*-->\s*\d{2}:\d{2}:\d{2},\d{3}/.test(lines[1]);
|
|
@@ -399,7 +399,7 @@ function normalizeTimestamp(ts) {
|
|
|
399
399
|
}
|
|
400
400
|
function parseSrtContent(content) {
|
|
401
401
|
const cues = [];
|
|
402
|
-
const blocks = content.trim().split(/\n\n+/);
|
|
402
|
+
const blocks = content.replace(/\r\n/g, "\n").trim().split(/\n\n+/);
|
|
403
403
|
for (const block of blocks) {
|
|
404
404
|
const lines = block.trim().split("\n");
|
|
405
405
|
if (lines.length < 3) continue;
|
|
@@ -1452,7 +1452,7 @@ async function renderViaCli(content, theme, format) {
|
|
|
1452
1452
|
*/
|
|
1453
1453
|
function parseTranscriptMarkdown(content) {
|
|
1454
1454
|
const cues = [];
|
|
1455
|
-
const lines = content.split("\n");
|
|
1455
|
+
const lines = content.replace(/\r\n/g, "\n").split("\n");
|
|
1456
1456
|
let i = 0;
|
|
1457
1457
|
while (i < lines.length) {
|
|
1458
1458
|
const tsMatch = lines[i].match(/\*\*\[(\d{2}:\d{2}:\d{2}\.\d{3})\s*-->\s*(\d{2}:\d{2}:\d{2}\.\d{3})\]\*\*\s*(.*)/);
|