@@ -43,43 +43,45 @@ function cleanupCss(str) {
43
43
var mdBodyProps = [ ] ;
44
44
45
45
style . stylesheet . rules = style . stylesheet . rules . filter ( function ( el ) {
46
- if ( el . type === 'keyframes' || el . type === 'comment' ) {
46
+ if ( el . type === 'keyframes' || el . type === 'comment' || el . type === 'font-face' ) {
47
47
return false ;
48
48
}
49
49
50
- if ( el . type === 'rule' && / : : - w e b k i t - v a l i d a t i o n | : - m o z - p l a c e h o l d e r | ^ \. i n t e g r a t i o n s - s l i d e - c o n t e n t | ^ \. p r o s e - d i f f | @ f o n t - f a c e | ^ \. o c t i c o n | ^ b u t t o n : : | ^ \. m a r k d o w n - b o d y .+ ( : h o v e r | \. o c t i c o n ) | ^ a r t i c l e $ / . test ( el . selectors [ 0 ] ) ) {
51
- return false ;
52
- }
50
+ if ( el . type === 'rule' ) {
51
+ if ( / : : - w e b k i t - v a l i d a t i o n | : - m o z - p l a c e h o l d e r | ^ \. i n t e g r a t i o n s - s l i d e - c o n t e n t | ^ \. p r o s e - d i f f | @ f o n t - f a c e | ^ \. o c t i c o n | ^ b u t t o n : : | ^ \. m a r k d o w n - b o d y .+ ( : h o v e r | \. o c t i c o n ) | ^ a r t i c l e $ / . test ( el . selectors [ 0 ] ) ) {
52
+ return false ;
53
+ }
53
54
54
- if ( el . selectors . length === 1 && / ^ (?: h t m l | b o d y ) $ / . test ( el . selectors [ 0 ] ) ) {
55
- el . declarations = el . declarations . filter ( function ( declaration ) {
56
- if ( ! / ^ f o n t | ^ (?: l i n e - h e i g h t | c o l o r ) $ | t e x t - s i z e - a d j u s t $ / . test ( declaration . property ) ) {
57
- return false ;
58
- }
55
+ if ( el . selectors . length === 1 && / ^ (?: h t m l | b o d y ) $ / . test ( el . selectors [ 0 ] ) ) {
56
+ el . declarations = el . declarations . filter ( function ( declaration ) {
57
+ if ( ! / ^ f o n t | ^ (?: l i n e - h e i g h t | c o l o r ) $ | t e x t - s i z e - a d j u s t $ / . test ( declaration . property ) ) {
58
+ return false ;
59
+ }
59
60
60
- return true ;
61
- } ) ;
62
- }
63
-
64
- el . selectors = el . selectors . map ( function ( selector ) {
65
- if ( / ^ (?: b o d y | h t m l ) $ / . test ( selector ) ) {
66
- selector = '.markdown-body' ;
61
+ return true ;
62
+ } ) ;
67
63
}
68
64
69
- if ( ! / \. m a r k d o w n - b o d y / . test ( selector ) ) {
70
- selector = '.markdown-body ' + selector ;
71
- }
65
+ el . selectors = el . selectors . map ( function ( selector ) {
66
+ if ( / ^ (?: b o d y | h t m l ) $ / . test ( selector ) ) {
67
+ selector = '.markdown-body' ;
68
+ }
72
69
73
- return selector ;
74
- } ) ;
70
+ if ( ! / \. m a r k d o w n - b o d y / . test ( selector ) ) {
71
+ selector = '.markdown-body ' + selector ;
72
+ }
75
73
76
- if ( el . declarations . length === 0 ) {
77
- return false ;
74
+ return selector ;
75
+ } ) ;
76
+
77
+ // collect `.markdown-body` rules
78
+ if ( el . selectors . length === 1 && el . selectors [ 0 ] === '.markdown-body' ) {
79
+ [ ] . push . apply ( mdBodyProps , el . declarations ) ;
80
+ return false ;
81
+ }
78
82
}
79
83
80
- // collect `.markdown-body` rules
81
- if ( el . selectors . length === 1 && el . selectors [ 0 ] === '.markdown-body' ) {
82
- [ ] . push . apply ( mdBodyProps , el . declarations ) ;
84
+ if ( el . declarations . length === 0 ) {
83
85
return false ;
84
86
}
85
87
0 commit comments