Merge pull request #1903 from ostephens/replace-smart-quotes

Add Common transform which replaces smart quotes with ascii equivalent
This commit is contained in:
Antonin Delpeuch 2018-12-12 12:09:49 +00:00 committed by GitHub
commit 9656ea3f8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -604,6 +604,7 @@
"core-views/trim-all": "Trim leading and trailing whitespace",
"core-views/collapse-white": "Collapse consecutive whitespace",
"core-views/unescape-html": "Unescape HTML entities",
"core-views/replace-smartquotes": "Replace Smart quotes with ascii",
"core-views/titlecase": "To titlecase",
"core-views/uppercase": "To uppercase",
"core-views/lowercase": "To lowercase",

View File

@ -384,6 +384,11 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) {
label: $.i18n('core-views/unescape-html'),
click: function() { doTextTransform("value.unescape('html')", "keep-original", true, 10); }
},
{
id: "core/replace-smartquotes",
label: $.i18n('core-views/replace-smartquotes'),
click: function() { doTextTransform("value.replace(/[\u2018\u2019\u201A\u201B\u2039\u203A\u201A]/,\"\\\'\").replace(/[\u201C\u201D\u00AB\u00BB\u201E]/,\"\\\"\")", "keep-original", false, ""); }
},
{},
{
id: "core/to-titlecase",