Skip to content

Save compressed xml into SVG in desktop mode (export via CLI). #2143

@nalajcie

Description

@nalajcie
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Is your feature request related to a problem? Please describe.
No option to save compressed xml into svg in desktop version cli.

Describe the solution you'd like

diff --git a/src/main/webapp/js/export.js b/src/main/webapp/js/export.js
index 380e8c3f..e497b669 100644
--- a/src/main/webapp/js/export.js
+++ b/src/main/webapp/js/export.js
@@ -426,7 +426,7 @@ function render(data)

                                                                if (editable)
                                                                {
-                                                                       svgRoot.setAttribute('content', getFileXml());
+                                                                       svgRoot.setAttribute('content', getFileXml(data.uncompressed));
                                                                }

                                                                electron.sendMessage('svg-data',

(+ help message change in desktop version)

NOTE: this changes default mode in cli export to compressed xml - but this also is the default for embedded mode so IMHO it makes sense to align how export looks by default.

Describe alternatives you've considered
Not really, did the change locally and it works for me :).

Additional context
Encountered some problems when migrating from Confluence draw.io plugin (mx files + separate PNGs) to YouTrack (svg+xml embedded mode) - resolved by batch-converting the files using the REST API.

The uncompressed XML resulted in malformed national chars (didn't want to dig into JS to find where exactly lies an error, the data was supposedly passed as base64 datastream, so all decoding might have been done by drawio ). The compressed XML solves the problem with malformed UTF-8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions