Batch creation of notes from url list. Provide a list of urls where every line is a valid url like below. Each url will be treated individually. So 2 notes will be created
# some heading to indicate "this is a single note of urls"
https://www.youtube.com/watch?v=uLMD_u41GlA
https://www.tiktok.com/@toontimemadness/video/7346280539004931334
https://www.youtube.com/watch?v=uLMD_u41GlA
other random non-url data
Non batch behaviour
Batch processing disabled
all data sets end up as snippet notes
batch behaviour
Batch processing enabled
valid data end up in two individual notes
invalid data will result in snippet note again
Types of changes
Changes visible to users:
[x] New feature Batch processing of URLs (disabled by default in settings)
Internal changes:
[x] Refactor re-used isValidUrl from fileutils.ts in Parser.ts to eliminate code duplication
[x] fixisValidUrl gave false positives for multi line input eg some-string\nhttps://www.youtube.com/watch?v=uLMD_u41GlA. Fixed that by trimming the string and returning false immediately if there are still line breaks in the string.
Checklist
[x] My code follows the code style of this project and passes npm run lint.
I cleaned up complexity in processClipboard by adding two private methods _processUrlSingle and _processUrlsBatch that get called from within processClipboard
Description
Motivation and Context
Batch creation of notes from url list. Provide a list of urls where every line is a valid url like below. Each url will be treated individually. So 2 notes will be created
How has this been tested?
manual testing in obsidian with a local build of the addon.
Test data
Valid data for batch processing
Invalid data
Non batch behaviour
batch behaviour
valid data
end up in two individual notesinvalid data
will result in snippet note againTypes of changes
Changes visible to users:
Internal changes:
isValidUrl
fromfileutils.ts
inParser.ts
to eliminate code duplicationisValidUrl
gave false positives for multi line input egsome-string\nhttps://www.youtube.com/watch?v=uLMD_u41GlA
. Fixed that by trimming the string and returning false immediately if there are still line breaks in the string.Checklist
npm run lint
.