Skip to content

Fix generated IconData body for SVGs containing ##13

Open
sonicjhon1 wants to merge 2 commits into
davidB:mainfrom
sonicjhon1:main
Open

Fix generated IconData body for SVGs containing ##13
sonicjhon1 wants to merge 2 commits into
davidB:mainfrom
sonicjhon1:main

Conversation

@sonicjhon1

Copy link
Copy Markdown

Summary

This PR fixes icon code generation for SVG content that contains sequences such as "#fff".

Previously, generated icon bodies used r#"... "# raw string literals. SVG attributes like fill="#fff" contain the "# sequence, which prematurely terminates the raw string and causes the generated Rust code to fail to compile.

The generator now emits icon bodies using r###"..."###, preventing conflicts with common SVG attribute values.

Changes

  • Change generated IconData body literals from r#"... "# to r###"..."###
  • Add logos:chrome to the integration test suite as a regression test
  • Verify generated code compiles successfully when SVG content contains color attributes such as fill="#fff"

Example

Before:

body: r#"<path fill="#fff" />"#,

After:

body: r###"<path fill="#fff" />"###,

Testing

  • Updated test_generated_code_compiles
  • Added logos:chrome, which contains SVG attributes that previously triggered the issue
  • Confirmed generated code compiles successfully

Closes #12

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the generated icon body string delimiter in src/generator.rs to use three hash marks (r###"..."###) instead of one, and adds integration tests for the logos:chrome icon. However, changing the raw string delimiter breaks the parser in extract_raw_string_value which specifically looks for r#" and "#. The parser needs to be updated to support the new delimiter or dynamically handle the number of hash marks.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/generator.rs
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.

Icons which have fill="#fff" breaks

1 participant