Fix timestamp regex error

## Issue
https://discord.com/channels/362322208485277697/363087331475062785/817972023347249153

## Change
Open up the range as per YT, indirectly fixing the regex mistake.
This commit is contained in:
infinite-persistence 2021-03-09 23:10:43 +08:00 committed by Sean Yesmunt
parent 11fdbcaee5
commit a33087440c

View file

@ -51,8 +51,8 @@ function findNextTimestamp(value, fromIndex, strictlyFromIndex) {
case 7: // "9:59:59"
isValidTimestamp = /^[0-9]:[0-5][0-9]:[0-5][0-9]$/.test(str);
break;
case 8: // "23:59:59"
isValidTimestamp = /^[0-2][0-3]:[0-5][0-9]:[0-5][0-9]$/.test(str);
case 8: // "99:59:59"
isValidTimestamp = /^[0-9][0-9]:[0-5][0-9]:[0-5][0-9]$/.test(str);
break;
default:
// Reject
@ -84,7 +84,7 @@ function locateTimestamp(value, fromIndex) {
}
// Generate 'timestamp' markdown node
const createTimestampNode = text => ({
const createTimestampNode = (text) => ({
type: TIMESTAMP_NODE_TYPE,
value: text,
children: [{ type: 'text', value: text }],
@ -145,7 +145,7 @@ const transformer = (node, index, parent) => {
}
};
const transform = tree => {
const transform = (tree) => {
visit(tree, [TIMESTAMP_NODE_TYPE], transformer);
};