Update encoder.js EncodeAttributes and Values#4
Open
Diferno wants to merge 2 commits intoclncln1:masterfrom
Diferno:patch-1
Open
Update encoder.js EncodeAttributes and Values#4Diferno wants to merge 2 commits intoclncln1:masterfrom Diferno:patch-1
Diferno wants to merge 2 commits intoclncln1:masterfrom
Diferno:patch-1
Conversation
Hi! this pull request encodes the attributes, with prefix and defined values.
The codePage should have those new entries if desired (note attributes and values arrays and prefix field in the attribute objects)
{
name: 'test2',
tags: [
{ name: 'CARD', token: 0x05 },
{ name: 'INPUT', token: 0x06 },
{ name: 'XYZ', token: 0x07 },
{ name: 'DO', token: 0x08 }
],
attributes: [
//ATTRIBUTES
{ name: 'STYLE', prefix: 'LIST', token: 0x05 },
{ name: 'TYPE', token: 0x06 },
{ name: 'TYPE', prefix: 'TEXT', token: 0x07 },
{ name: 'URL', prefix: 'http://', token: 0x08 },
{ name: 'NAME', token: 0x09 },
{ name: 'KEY', token: 0x0A }
],
values: [
//ATTRIBUTE values
{ name: '.org', token: 0x85 },
{ name: 'ACCEPT', token: 0x86 }
]
}
Fixed bug when changing codePage and adding 01 to close Attributes Lists
Diferno
commented
Sep 28, 2016
Contributor
Author
Diferno
left a comment
There was a problem hiding this comment.
fixed bug when changing codePage and added EndToken after attributes list
clncln1
requested changes
Dec 6, 2016
| if (tagCodePage !== currentCodePage) { | ||
| //switch code page | ||
| tagBuffer = new Buffer([SWITCH_PAGE_TOKEN, tagCodePage]); | ||
| tagBuffer = Buffer.concat([tagBuffer, new Buffer([SWITCH_PAGE_TOKEN, tagCodePage])]) |
Owner
There was a problem hiding this comment.
Shouldn't the SWITCH_PAGE be happening before the tag declaration?
Contributor
Author
There was a problem hiding this comment.
From my tests, I think it works as intended this way. Otherwise the tags are not being closed correctly.
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.
Hi! this pull request encodes the attributes, with prefix and defined values.
The codePage should have those new entries if desired (note attributes and values arrays and prefix field in the attribute objects)