mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
DOM: Change the attribute node's quoted member to be unsigned char
It can hold NUL, ', or " depending on not quoted, single quoted or double quoted.
This commit is contained in:
parent
bc50084475
commit
a3dcc7d5e5
@ -111,6 +111,9 @@ struct dom_attribute_node {
|
|||||||
* to reduce string comparing and only do one fast find mapping. */
|
* to reduce string comparing and only do one fast find mapping. */
|
||||||
uint16_t type;
|
uint16_t type;
|
||||||
|
|
||||||
|
/* The attribute value is delimited by quotes. Can be NUL, ' or ". */
|
||||||
|
unsigned char quoted;
|
||||||
|
|
||||||
/* Was the attribute specified in the DTD as a default attribute or was
|
/* Was the attribute specified in the DTD as a default attribute or was
|
||||||
* it added from the document source. */
|
* it added from the document source. */
|
||||||
unsigned int specified:1;
|
unsigned int specified:1;
|
||||||
@ -124,9 +127,6 @@ struct dom_attribute_node {
|
|||||||
|
|
||||||
/* The attribute value references some other resource */
|
/* The attribute value references some other resource */
|
||||||
unsigned int reference:1;
|
unsigned int reference:1;
|
||||||
|
|
||||||
/* The attribute value is delimited by quotes */
|
|
||||||
unsigned int quoted:1;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct dom_text_node {
|
struct dom_text_node {
|
||||||
|
@ -95,7 +95,7 @@ add_sgml_attribute(struct dom_stack *stack,
|
|||||||
node->data.attribute.reference = !!(info->flags & SGML_ATTRIBUTE_REFERENCE);
|
node->data.attribute.reference = !!(info->flags & SGML_ATTRIBUTE_REFERENCE);
|
||||||
|
|
||||||
if (valtoken && valtoken->type == SGML_TOKEN_STRING)
|
if (valtoken && valtoken->type == SGML_TOKEN_STRING)
|
||||||
node->data.attribute.quoted = 1;
|
node->data.attribute.quoted = valtoken->string.string[-1];
|
||||||
|
|
||||||
if (!node || push_dom_node(stack, node) != DOM_STACK_CODE_OK)
|
if (!node || push_dom_node(stack, node) != DOM_STACK_CODE_OK)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user