Skip to content

Normalize HTML Title Whitespace #645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

mookums
Copy link
Contributor

@mookums mookums commented May 14, 2025

This solves the failing WPT: html/dom/documents/dom-tree-accessors/document.title-03.html by ensuring that any whitespace subslices are replaced by a single space.

@karlseguin
Copy link
Collaborator

You might be able to do this without an allocator.

The web apis, i.e. set_title, can take a title: []u8 rather than a []const u8, so you could normalize it in-place.

That leaves documentHTMLParse, and the question becomes, can the dom_string you get from get_title be mutated and passed back to set_title?? Worst case you could use the netsurf arena to create the new string, i.e. c.dom_string_create

@mookums mookums force-pushed the normalize-title-spaces branch from bef3985 to 4a849e5 Compare May 16, 2025 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants