MARC editor strips leading and trailing spaces from tabs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Undecided
|
Unassigned | ||
Bug Description
This basically happens anytime .toXMLString() is called on xml_record, such as when you save the record or toggle the flat-text editor, and is likely a consequence of our use of E4X (for having XML be a native datatype) and the XML standard not treating such space as significant by default. It's particularly heinous when a fixed field is thus stripped.
As a fix, I tried setting @xml:space=
This is what I last tried with xml:space:
diff --git a/Open-
index 066a084..1e28639 100644
--- a/Open-
+++ b/Open-
@@ -492,6 +492,14 @@ function setFocusToNextTag (row, direction) {
function createMARCTextbox (element,attrs) {
+ try {
+ var xml = new Namespace("xml", "http://
+ element.
+ element.@xml::space = "preserve";
+ } catch(E) {
+ alert('Error setting @xml:space: ' + E);
+ }
+
var box = createComplexXU
box.
box.onkeypress = function (event) {
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
Dan pointed out the following: old.nabble. com/E4X- and-whitespace- td2832695. html
http://
Strangely, I get a syntax error whenever I try to include it in marcedit.js, though it executes without error in the Javascript Shell or in the debug toolbar in the MARC Editor context. But it doesn't seem to fix the behavior.
https:/ /developer. mozilla. org/en/ E4X_Tutorial/ The_global_ XML_object