Skip to content

fix: every run adds newlines in web/index.html#817

Open
moritz-hoelting wants to merge 3 commits into
jonbhanson:masterfrom
moritz-hoelting:fix/web-increasing-newlines
Open

fix: every run adds newlines in web/index.html#817
moritz-hoelting wants to merge 3 commits into
jonbhanson:masterfrom
moritz-hoelting:fix/web-increasing-newlines

Conversation

@moritz-hoelting

Copy link
Copy Markdown

Rather than removing and adding elements (including whitespace), replacing the element if it exists does not add newlines.

Fixes the issue mentioned in #816.

@jonbhanson

Copy link
Copy Markdown
Owner

@nicholaschiang can you verify this fixes #816?

@moritz-hoelting

Copy link
Copy Markdown
Author

@nicholaschiang can you verify this fixes #816?

Would it be possible for you to test it yourself? I would like to use the upstream version in my project instead of my fork. Thanks

@Bungeefan

Copy link
Copy Markdown
Collaborator

Without looking too much at the code, I can at least confirm that this fixes the missing idempotency for index.html in an older project of mine.
(except for a small issue that you still can't have a trailing newline in the file, however, this is just my IDE setting and not really related to this)

@Bungeefan

Copy link
Copy Markdown
Collaborator

@moritz-hoelting Can you please remove the pubspec.lock file from your changes?

rather than removing and adding elements (including whitespace), replacing the element if it exists does not add newlines
@moritz-hoelting moritz-hoelting force-pushed the fix/web-increasing-newlines branch from ae571de to d4d45aa Compare May 23, 2026 19:50
@moritz-hoelting

Copy link
Copy Markdown
Author

@moritz-hoelting Can you please remove the pubspec.lock file from your changes?

done

Comment thread lib/web.dart

// Update splash image
document.querySelector('picture#splash')?.remove();
document.querySelector('div#splash')?.remove();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably still keep this for now (same as above)

Comment thread lib/web.dart
Comment on lines -55 to -56
document.querySelector('picture#splash')?.remove();
document.querySelector('picture#splash-branding')?.remove();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for dropping these?

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.

3 participants