LP1841823 Marc flat editor repair slashes (AngJS)
authorBill Erickson <berickxx@gmail.com>
Mon, 16 Sep 2019 15:26:23 +0000 (11:26 -0400)
committerBill Erickson <berickxx@gmail.com>
Fri, 21 Feb 2020 16:44:38 +0000 (11:44 -0500)
Replace all control field spaces with backslashes in MARC Flat text
editor (AngJS edition).

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Elaine Hardy <ehardy@georgialibraries.org>
Open-ILS/web/js/ui/default/staff/marcrecord.js

index 9fe525b..2e3a422 100644 (file)
@@ -297,7 +297,7 @@ var MARC21 = {
                             new MARC21.Field({
                                 record : me,
                                 tag    : line_tag(current_line),
-                                data   : cf_line_data(current_line).replace('\\',' ','g'),
+                                data   : cf_line_data(current_line).replace(/\\/g, ' ')
                             })
                         );
                     }
@@ -367,7 +367,7 @@ var MARC21 = {
 
             mtxt += this.fields.map( function (f) {
                 if (f.isControlfield()) {
-                    if (f.data) return '=' + f.tag + ' ' + f.data.replace(' ','\\','g');
+                    if (f.data) return '=' + f.tag + ' ' + f.data.replace(/ /g, '\\');
                     return '=' + f.tag;
                 } else {
                     return '=' + f.tag + ' ' +