Skip to content

Attributes in XML are sorted even if objsort:false #420

@carnegie-jwilliamson

Description

@carnegie-jwilliamson

I was formatting XML with mode:beautify textpreserve:true force_attribute:true objsort:none but the attributes were still being sorted. Changing lib/markuppretty.js:1300 fixed it for me:

@@ -1297,7 +1298,7 @@
                         if (tname.slice(0, 3) === "cf_") {
                             cft = "required";
                         }
-                        if (options.jsx === false && cft === undefined) {
+                        if (objsortop == true && options.jsx === false && cft === undefined) {
                             attstore = safeSort(attstore);
                         }
                         for (ind = 0; ind < len; ind += 1) {

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions