Skip to content
This repository was archived by the owner on May 8, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions demo/app/font-awesome.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.fa-glass:before {
content: "\f000";
content: '\f000';
}
.fa-music:before {
content: "\f001";
content: '\f001';
}
.fa-search:before {
content: "\f002";
Expand Down
2 changes: 1 addition & 1 deletion src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const mapCss = (data: any, debug?: boolean): object => {
};

export const cleanValue = (val: string): string | void => {
const matches = val.match(/content\s*:\s*"\\f([^"]+)"/i);
const matches = val.match(/content\s*:\s*["|']\\f([^"|^']+)["|']/i)
if (matches) {
return `\\uf${matches[1]}`;
}
Expand Down
7 changes: 7 additions & 0 deletions src/test/cleanvalue.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,11 @@ describe('Test cleanValue function', () => {
);
});

it('with single quotes', () => {
assert.strictEqual(
lib.cleanValue("content: '\\f000'; "),
'\\uf000',
);
});

});
2 changes: 1 addition & 1 deletion src/test/font-awesome.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
}
.fa-gear:before, .fa-cog:before{ content:"\f013"; }
.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}
.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}
.fa-dedent:before,.fa-outdent:before{content:'\f03b'}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:'\f03e'}