Automattic / Automattic/gridicons

Build: use a DOM-aware library to manipulate SVGs

Open
#123 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
PHP
Stars
116
Forks
14
PR merge metrics
No merged PRs in 30d

Description

Following from the discussion in #122, would be better if we were able to replace direct string manipulation with XML (SVG) aware libraries, such as [cheerio](https://github.com/cheeriojs/cheerio). This would make the code more reliable in the long term.

Example of direct string manipulation:

```
fileContent = fileContent.slice( 0, -6 ) +
'' +
fileContent.slice( -6 );
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the discussion in issue #122 and inspect the build code containing the shown direct string manipulation of SVG content. Compare the current approach with a DOM-aware library such as Cheerio and establish the reliability and completion criteria before attempting the broader refactor.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.