GumboAttribute(3)

πŸ“¦
version 0.12.1 Β· 4 versions
, in fedora 43

πŸ’– 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

  • GumboAttributeNamespaceEnum attr_namespace
  • const char * name
  • GumboStringPiece original_name
  • const char * value
  • GumboStringPiece original_value
  • GumboSourcePosition name_start
  • GumboSourcePosition name_end
  • GumboSourcePosition value_start
  • GumboSourcePosition value_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:

http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#adjust-foreign-attributes

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