File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 22
33if ( hexo . config . symbols_count_time ) {
44
5- var helper = require ( './lib/helper' ) ;
5+ const helper = require ( './lib/helper' ) ;
6+ const stripHTML = require ( 'hexo-util' ) . stripHTML ;
67
78 if ( hexo . config . symbols_count_time . symbols ) {
89 hexo . extend . helper . register ( 'symbolsCount' , helper . symbolsCount ) ;
@@ -22,11 +23,9 @@ if (hexo.config.symbols_count_time) {
2223
2324 if ( hexo . config . symbols_count_time . symbols || hexo . config . symbols_count_time . time || hexo . config . symbols_count_time . total_symbols || hexo . config . symbols_count_time . total_time ) {
2425 hexo . extend . filter . register ( 'after_post_render' , function ( data ) {
25- var util = require ( 'hexo-util' ) ;
26- var stripHTML = util . stripHTML ;
27- var content = data . content . replace ( / < t d c l a s s = \" g u t t e r \" > .* ?< \/ t d > / g, "" ) ;
28- if ( hexo . config . symbols_count_time . exclude_codeblock ) content = content . replace ( / < t d c l a s s = \" c o d e \" > .* ?< \/ t d > / g, "" ) ;
29- data . length = stripHTML ( content ) . length ;
26+ var content = data . content ;
27+ if ( hexo . config . symbols_count_time . exclude_codeblock ) content = content . replace ( / < p r e > .* ?< \/ p r e > / g, '' ) ;
28+ data . length = stripHTML ( content ) . replace ( / \n / g, '' ) . length ;
3029 } , 0 ) ;
3130 }
3231
Original file line number Diff line number Diff line change 22 "name" : " hexo-symbols-count-time" ,
33 "description" : " Symbols count and time to read for articles." ,
44 "main" : " index" ,
5- "version" : " 0.6.0 " ,
5+ "version" : " 0.6.1 " ,
66 "engines" : {
77 "node" : " >= 0.10.0"
88 },
You can’t perform that action at this time.
0 commit comments