Skip to content
This repository has been archived by the owner on May 8, 2023. It is now read-only.

CSS parsing brakes in the presence of new-lines #65

Open
jalberto-ghub opened this issue Jan 30, 2020 · 1 comment
Open

CSS parsing brakes in the presence of new-lines #65

jalberto-ghub opened this issue Jan 30, 2020 · 1 comment

Comments

@jalberto-ghub
Copy link

If the CSS file contains the definitions like this:

.icofont-spanner:before
{
content: "\eff1";
}

The parsing of the files breaks because the code will not split correctly. After much debugging had to do the following to solve it:

    TNSFontIconModule.forRoot({
        'icofont': require('../fonts/icofont-ngx.css').default.replace(/[\r\n]+/g, ' ' )
    }),

I.e. remove all the new lines while loading the file, so that it can be parsed by the current code.
The parsing code should take care of it.

@jalberto-ghub
Copy link
Author

To make the issue more clear, the current code is using:

let pair = set.replace(/ /g, "").split(":before{");

Which will not split on the presence of new-lines and as a consequence the definition is ignored.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant