Skip to content

Commit

Permalink
dev: delete gumbo_normalize_svg_tagname (#3402)
Browse files Browse the repository at this point in the history
**What problem is this PR intended to solve?**

It's unused. See discussion at #2950
  • Loading branch information
flavorjones authored Jan 3, 2025
2 parents 8d1582a + 61c8581 commit e2b666f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
15 changes: 0 additions & 15 deletions gumbo-parser/src/nokogiri_gumbo.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,21 +318,6 @@ const char* gumbo_normalized_tagname(GumboTag tag);
*/
void gumbo_tag_from_original_text(GumboStringPiece* text);

/**
* Fixes the case of SVG elements that are not all lowercase. This is
* not done at parse time because there's no place to store a mutated
* tag name. `tag_name` is an enum (which will be `TAG_UNKNOWN` for most
* SVG tags without special handling), while `original_tag_name` is a
* pointer into the original buffer. Instead, we provide this helper
* function that clients can use to rename SVG tags as appropriate.
* Returns the case-normalized SVG tagname if a replacement is found, or
* `NULL` if no normalization is called for. The return value is static
* data and owned by the library.
*
* @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign
*/
const char* gumbo_normalize_svg_tagname(const GumboStringPiece* tagname);

/**
* Converts a tag name string (which may be in upper or mixed case) to a
* tag enum.
Expand Down
8 changes: 0 additions & 8 deletions gumbo-parser/src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1962,14 +1962,6 @@ static void merge_attributes (
#endif
}

const char* gumbo_normalize_svg_tagname(const GumboStringPiece* tag) {
const StringReplacement *replacement = gumbo_get_svg_tag_replacement (
tag->data,
tag->length
);
return replacement ? replacement->to : NULL;
}

// https://html.spec.whatwg.org/multipage/parsing.html#adjust-foreign-attributes
// This destructively modifies any matching attributes on the token and sets the
// namespace appropriately.
Expand Down

0 comments on commit e2b666f

Please sign in to comment.