diff --git a/Scripts/DoubleQuotesToSingles.js b/Scripts/DoubleQuotesToSingles.js new file mode 100644 index 00000000..1397ce5f --- /dev/null +++ b/Scripts/DoubleQuotesToSingles.js @@ -0,0 +1,19 @@ +/** + { + "api":1, + "name":"Double Quotes to Singles", + "description":"Converts all double quotes to single quotes", + "author":"Joshfindit", + "icon":"quote", + "tags":"convert,quote,quotes,json" + } +**/ + +function main(state) { + try { + state.text = state.fullText.replace(/"/g, "'") + } + catch(error) { + state.postError("Something strange happened while trying to replace quotes") + } +} diff --git a/Scripts/SingleQuotesToDoubles.js b/Scripts/SingleQuotesToDoubles.js new file mode 100644 index 00000000..643941af --- /dev/null +++ b/Scripts/SingleQuotesToDoubles.js @@ -0,0 +1,19 @@ +/** + { + "api":1, + "name":"Single Quotes to Doubles", + "description":"Converts all single quotes to double quotes", + "author":"Joshfindit", + "icon":"quote", + "tags":"convert,quote,quotes,json" + } +**/ + +function main(state) { + try { + state.text = state.fullText.replace(/'/g, '"') + } + catch(error) { + state.postError("Something strange happened while trying to replace quotes") + } +}