jonkemp / jonkemp/inline-css

Bug | Pseudo Check (Sanity required)

Open
#105 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
438
Forks
77
PR merge metrics
No merged PRs in 30d

Description

At the pseudoCheck.js library's code, at line `25`, need to add an extra sanity (*or before*), as stylesheet like the following below, will break it:

```
, something { font-size: 12px; } p { font-color: red; } a { margin: 0.1em; }
```

This is because of the **comma** (`,`) before the `something` element is presented with his styles, the library will try to parse that, and will return an array with first element index as **empty string**, and second, with the CSS object structure.

**Screenshot explained**:

![webstorm64_t3HxuRRRjD](https://user-images.githubusercontent.com/21152343/124780817-9331fc80-df4b-11eb-9fd5-48c03bd107e9.png)
*inline-css.js*

**With an error of**:

```
TypeError: Cannot read property 'length' of undefined
at module.exports (D:\XYZ\WebstormProjects\TestApp\node_modules\inline-css\lib\pseudoCheck.js:27:36)
at D:\XYZ\WebstormProjects\TestApp\node_modules\inline-css\lib\inline-css.js:72:26
at Array.forEach ()
at module.exports (D:\XYZ\WebstormProjects\TestApp\node_modules\inline-css\lib\inline-css.js:68:11)
at D:\WebstormProjects\TestApp\node_modules\inline-css\lib\inlineContent.js:22:27
at D:\XYZ\WebstormProjects\TestApp\node_modules\extract-css\index.js:37:16
at D:\XYZ\WebstormProjects\TestApp\node_modules\batch\index.js:161:14
at processTicksAndRejections (internal/process/task_queues.js:79:11)
```

![webstorm64_xg6NRJjpMd](https://user-images.githubusercontent.com/21152343/124781028-c1174100-df4b-11eb-93ac-34c668a8563b.png)
*pseudoCheck.js*

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.