Skip to content

Commit

Permalink
implemented regex HTML strip, then removed it
Browse files Browse the repository at this point in the history
  • Loading branch information
DC23 committed Nov 27, 2024
1 parent fc58096 commit 88acdb6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion module/settings/saves-settings.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,13 @@ class SavesSettings extends FormApplication {
const data = foundry.utils.expandObject(formData)
const current = game.settings.get(SYSTEM_ID, SETTINGS.SAVES_SETTINGS)

// todo: escape html
for (let [k, v] of Object.entries(data)) {
// trim trailing and leading whitespace then strip out all HTML tags
// Has an unfortunate effect of deleting the entire string if someone types in '<Spells>'
// if we really want to strip HTML, then a library is the best bet.
// data[k] = v?.trim()?.replace(/<\/?[^>]+(>|$)/g, '')

// just do whitespace for now
data[k] = v.trim()
}

Expand Down

0 comments on commit 88acdb6

Please sign in to comment.