updated regex replacement to include old text in debug logging
This commit is contained in:
parent
7740822918
commit
8d2c808c68
1 changed files with 2 additions and 1 deletions
3
index.js
3
index.js
|
|
@ -114,9 +114,10 @@ export default async function now() {
|
|||
const matched = regex.test(newNow)
|
||||
console.log(`Regex match found: ${matched}`)
|
||||
|
||||
newNow = newNow.replace(regex, (match, openTag, closeTag) => {
|
||||
newNow = newNow.replace(regex, (match, openTag, oldText, closeTag) => {
|
||||
console.log(`DEBUG: Replacing match for ${item.id}`)
|
||||
console.log(`Old match: ${match}`)
|
||||
console.log(`Old text: ${oldText}`)
|
||||
// replace href in opening tag
|
||||
const updatedOpenTag = openTag.replace(
|
||||
/href=["'][^"']*["']/,
|
||||
|
|
|
|||
Loading…
Reference in a new issue