Skip to content

Conversation

@Diferno
Copy link
Contributor

@Diferno Diferno commented Sep 28, 2016

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 }
    ]
}

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
Copy link
Contributor Author

@Diferno Diferno left a comment

Choose a reason for hiding this comment

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

fixed bug when changing codePage and added EndToken after attributes list

if (tagCodePage !== currentCodePage) {
//switch code page
tagBuffer = new Buffer([SWITCH_PAGE_TOKEN, tagCodePage]);
tagBuffer = Buffer.concat([tagBuffer, new Buffer([SWITCH_PAGE_TOKEN, tagCodePage])])
Copy link
Owner

Choose a reason for hiding this comment

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

Shouldn't the SWITCH_PAGE be happening before the tag declaration?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From my tests, I think it works as intended this way. Otherwise the tags are not being closed correctly.

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