GumboAttribute(3)
π GumboAttribute π
okay bestie, welcome to the glow-up of GumboAttribute β the little struct that holds ONE attribute off an HTML tag. yes, one. she's small but she contains multitudes (name, value, AND receipts about where in the source she came from). we stan a self-aware queen. β¨
β¨ SYNOPSIS β¨
#include <gumbo.h>
π Data Fields
GumboAttributeNamespaceEnumattr_namespaceconst char *nameGumboStringPieceoriginal_nameconst char *valueGumboStringPieceoriginal_valueGumboSourcePositionname_startGumboSourcePositionname_endGumboSourcePositionvalue_startGumboSourcePositionvalue_end
π¦ Detailed Description
So, GumboAttribute is a struct representing a single attribute on an HTML tag. it's giving name-value pair, but she's not JUST that β she also carries information about source locations and the original source text. main character energy, truly. π
πΈ Field Documentation
π GumboAttributeNamespaceEnum GumboAttribute::attr_namespace
the namespace for the attribute, bestie. most of the time this is gonna be GUMBO_ATTR_NAMESPACE_NONE, but some XLink/XMLNS/XML attributes take special values, per:
iykyk π«Ά
π const char* GumboAttribute::name
the name of the attribute. this lives in a freshly-allocated buffer (because case-normalization said "i must"), and it is null-terminated. clean, cunty, correct. β¨
π GumboStringPiece GumboAttribute::original_name
the original text of the attribute name, as a pointer into the original source buffer. no copies, no drama, just a lil pointer back home. π
π const char* GumboAttribute::value
the value of the attribute. also in a freshly-allocated buffer (this time the reason is unescaping), and also null-terminated. important: it does NOT include any quotes that surround the attribute. and if the attribute has no value β like, say, 'selected' on a checkbox β this will be an empty string. not null, bestie, empty. different things!! π
π GumboStringPiece GumboAttribute::original_value
the original text of the value of the attribute. this points into the original source buffer, and unlike value, it DOES include any quotes that surround the attribute. wanna know which quote characters they were? go peek at original_value.data[0] and original_value.data[original_value.length - 1]. detective work, slay. π
and if the attribute has no value, this will be a 0-length string. periodt.
π GumboSourcePosition GumboAttribute::name_start
the starting position of the attribute name. π
π GumboSourcePosition GumboAttribute::name_end
the ending position of the attribute name. heads up: this is not always derivable from the starting position of the value, because there might be whitespace hanging around the = sign. so yeah, she has to tell you herself. π
π GumboSourcePosition GumboAttribute::value_start
the starting position of the attribute value. π
π GumboSourcePosition GumboAttribute::value_end
the ending position of the attribute value. π
π Author
Generated automatically by Doxygen for Gumbo from the source code. so like, not a human, but honestly? she ate. π«Ά
and that's the whole page, no notes π
Version 0.12.1 Β· Fri Sep 19 2025 00:00:00 Β· GumboAttribute(3) β mwah, go parse something iconic bestie ππ¦πΈ
π¦ where this page comes from
- fedora 43: gumbo-parser-devel 1:0.12.1-7.fc43 Β· Apache-2.0
- fedora 43: gumbo-parser-devel 1:0.12.1-7.fc43 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms