Skip to content

Conversation

@renatgalimov
Copy link
Contributor

@renatgalimov renatgalimov commented Sep 29, 2025

In v1.0.4, if you have a multi-line string in settings, it will generate an invalid JS.

We use serde_json to ensure that the content we build it a valid JSON. We use a JS parser to check the generated JS in tests.

Before this fix it would generate multi-line settings as:

   settings: {
       "enable_analytics": "true",
       "key": "value",
       "override_timezone": "",
       "tag_manager_id": "",
       "multi_line": "multi
line
string"
   },

How has this been tested?

  1. Update the test case and ensured that the test is faliing
  2. Implemented the fix.

Checklist before merging

  • If have updated tests.
  • Is this a new feature? No.
  • I've attached relevant screenshots (if relevant). No

@renatgalimov renatgalimov force-pushed the generate-valid-screenlyjs-for-multiline branch from 90e76f9 to 182f19d Compare September 29, 2025 12:12
In v1.0.4, if you have a multi-line string in settings, it will
generate an invalid JS.

We use serde_json to ensure that the content we build it a valid JSON.
We use a JS parser to check the generated JS in tests.
@renatgalimov renatgalimov force-pushed the generate-valid-screenlyjs-for-multiline branch from 182f19d to 9c0659f Compare September 29, 2025 12:15
@renatgalimov renatgalimov merged commit bde468a into master Sep 29, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants