Skip to content

Instantly share code, notes, and snippets.

@tayiorbeii
Created October 14, 2022 17:52
Show Gist options
  • Save tayiorbeii/b3017a3e356892d4bdd332ec458f5622 to your computer and use it in GitHub Desktop.
Save tayiorbeii/b3017a3e356892d4bdd332ec458f5622 to your computer and use it in GitHub Desktop.
import "@johnlindquist/kit"
// Name:
let outdent = await npm('tiny-dedent')
let replaceAll = await npm('just-replace-all')
let chunkArray = await npm('chunk')
let text = await paste()
let outdentedTextLines = text.split('\n')
let paragraphsArray = chunkArray(outdentedTextLines, 4)
let paragraphs = paragraphsArray.flat().map(x => x.replaceAll(/\[(?:(?:([0-9]?\d|[0-9]):)?([0-9]?\d):)?([0-9]?\d)]/g, '').trim()).join('\n')
await copy(paragraphs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment