Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#15] Replace newlines with ZPL equivalent #18

Merged
merged 3 commits into from
Sep 20, 2024
Merged

[#15] Replace newlines with ZPL equivalent #18

merged 3 commits into from
Sep 20, 2024

Conversation

itsmattking
Copy link
Collaborator

In FieldData, add an option to replace newlines \n with ZPL newline representation \&.

Also update FieldBlock extension to use this option so that any usage of fieldBlock will automatically replace newlines.

In FieldData, add an option to replace newlines `\n`
with ZPL newline representation `\&`.

Also update FieldBlock extension to use this option
so that any usage of fieldBlock will automatically
replace newlines.
Copy link

@jbduncan jbduncan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few queries, but otherwise this PR looks pretty decent to me. 👍

- Make newline replacement non-optional. It is very unlikely
we want to allow newline `\n` characters in field data as
this breaks ZPL output.
- Remove explicit use of `LinkedHashMap` as the `parameters` type
in favour of using just `Map`.
- Add helper `addParameters` to make explicit that we want a `LinkedHashMap`
to be used when adding parameters. This is to ensure key entry order is preserved.
@itsmattking itsmattking merged commit 500eaa9 into main Sep 20, 2024
2 checks passed
@itsmattking itsmattking deleted the issue/15 branch September 20, 2024 13:09
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