40,275
edits
m (try this) |
m (oops it's not inplace) |
||
if (edit.value.includes('</gallery>')) {
// add the lines to the end of the current gallery
edit.value = edit.value.replace('</gallery>', new_files.join("\n") +"\n</gallery>")
} else {
// create a gallery at the bottom of the page
|