mirror of
https://github.com/sindresorhus/github-markdown-css.git
synced 2024-03-22 13:10:53 +08:00
fix body font size regression
This commit is contained in:
parent
cbefe8761f
commit
9bee1ac647
|
@ -88,7 +88,6 @@
|
|||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.markdown-body,
|
||||
.markdown-body input {
|
||||
font: 13px Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
|
||||
line-height: 1.4;
|
||||
|
|
15
index.js
15
index.js
|
@ -57,13 +57,19 @@ function cleanupCss(str) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (el.selectors.length === 1 && /^(?:html|body)$/.test(el.selectors[0])) {
|
||||
el.declarations = el.declarations.filter(function (declaration) {
|
||||
if (!/^font|^(?:line-height|color)$|text-size-adjust$/.test(declaration.property)) {
|
||||
return false;
|
||||
// remove `body` from `body, input {}`
|
||||
if (el.selectors[0] === 'body' && el.selectors[1] === 'input') {
|
||||
el.selectors.shift();
|
||||
}
|
||||
|
||||
if (el.selectors.length === 1 && /^(?:html|body)$/.test(el.selectors[0])) {
|
||||
el.declarations = el.declarations.filter(function (declaration) {
|
||||
// remove everything from body/html other than these
|
||||
if (/^font|^(?:line-height|color)$|text-size-adjust$/.test(declaration.property)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -72,6 +78,7 @@ function cleanupCss(str) {
|
|||
selector = '.markdown-body';
|
||||
}
|
||||
|
||||
|
||||
if (!/\.markdown-body/.test(selector)) {
|
||||
selector = '.markdown-body ' + selector;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user