Feat/comment handling#18
Merged
Merged
Conversation
Hand-written ZPL often splits a logical comment across several ^FX lines before the field they describe. Previously each ^FX overwrote the pending comment, so only the last line reached the imported object. Accumulate them with newline separators; XA/XZ still reset at label boundaries.
^FX has no ^FH escape mechanism, so ^ or ~ inside comment text terminates the command and corrupts the surrounding ZPL. Strip them at the comment input so the user sees what will be saved, and keep the strip in the generator as a safety net. The previous output strip only covered ^; ~ would still break the structure.
`tsc --noEmit` (used pre-commit) and `tsc -b` (used in build) disagree on whether array index access on `objects` returns T|undefined. The build config has noUncheckedIndexedAccess on; match the existing optional-chaining pattern used elsewhere in this file.
There was a problem hiding this comment.
Code Review
This pull request introduces a utility to sanitize ZPL command characters from free-form text and improves the ZPL parser to support multi-line comments by accumulating consecutive ^FX lines. It also adds comprehensive unit tests for the new comment parsing logic and integrates the sanitization utility into the properties panel and ZPL generator. I have no feedback to provide.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.