Photon 1.0.0
Loading...
Searching...
No Matches
tag.c File Reference
#include "gumbo.h"
#include <assert.h>
#include <ctype.h>
#include <string.h>
#include "tag_strings.h"
#include "tag_sizes.h"
#include "tag_gperf.h"

Macros

#define TAG_MAP_SIZE   (sizeof(kGumboTagMap) / sizeof(kGumboTagMap[0]))
 

Functions

const char * gumbo_normalized_tagname (GumboTag tag)
 
void gumbo_tag_from_original_text (GumboStringPiece *text)
 
GumboTag gumbo_tagn_enum (const char *tagname, unsigned int length)
 
GumboTag gumbo_tag_enum (const char *tagname)
 

Variables

const char * kGumboTagNames []
 

Macro Definition Documentation

◆ TAG_MAP_SIZE

#define TAG_MAP_SIZE   (sizeof(kGumboTagMap) / sizeof(kGumboTagMap[0]))

Function Documentation

◆ gumbo_normalized_tagname()

const char * gumbo_normalized_tagname ( GumboTag  tag)

Returns the normalized (usually all-lowercased, except for foreign content) tag name for an GumboTag enum. Return value is static data owned by the library.

◆ gumbo_tag_enum()

GumboTag gumbo_tag_enum ( const char *  tagname)

Converts a tag name string (which may be in upper or mixed case) to a tag enum. The tag version expects tagname to be NULL-terminated

◆ gumbo_tag_from_original_text()

void gumbo_tag_from_original_text ( GumboStringPiece text)

Extracts the tag name from the original_text field of an element or token by stripping off </> characters and attributes and adjusting the passed-in GumboStringPiece appropriately. The tag name is in the original case and shares a buffer with the original text, to simplify memory management. Behavior is undefined if a string-piece that doesn't represent an HTML tag (<tagname> or </tagname>) is passed in. If the string piece is completely empty (NULL data pointer), then this function will exit successfully as a no-op.

◆ gumbo_tagn_enum()

GumboTag gumbo_tagn_enum ( const char *  tagname,
unsigned int  length 
)

Variable Documentation

◆ kGumboTagNames

const char* kGumboTagNames[]
Initial value:
= {
"",
"",
}