8000 fix .octoicons font name - fixes #9 · lbarr/github-markdown-css@8efcd68 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8efcd68

Browse files
committed
fix .octoicons font name - fixes sindresorhus#9
1 parent 9bee1ac commit 8efcd68

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

github-markdown.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@
748748
}
749749

750750
.markdown-body .octicon {
751-
font: normal normal 16px octicons;
751+
font: normal normal 16px octicons-anchor;
752752
line-height: 1;
753753
display: inline-block;
754754
text-decoration: none;

index.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,17 @@ function cleanupCss(str) {
6262
el.selectors.shift();
6363
}
6464

65+
// rename the .octoicons font
66+
if (el.selectors[0] === '.octicon') {
67+
el.declarations = el.declarations.map(function (el) {
68+
if (el.property === 'font') {
69+
el.value += '-anchor';
70+
}
71+
72+
return el;
73+
});
74+
}
75+
6576
if (el.selectors.length === 1 && /^(?:html|body)$/.test(el.selectors[0])) {
6677
el.declarations = el.declarations.filter(function (declaration) {
6778
// remove everything from body/html other than these
@@ -78,7 +89,6 @@ function cleanupCss(str) {
7889
selector = '.markdown-body';
7990
}
8091

81-
8292
if (!/\.markdown-body/.test(selector)) {
8393
selector = '.markdown-body ' + selector;
8494
}

0 commit comments

Comments
 (0)
0