@@ -67,7 +67,12 @@ class Styledown {
67
67
68
68
html = $ . html ( )
69
69
}
70
- return this . prettyprint ( html , { wrap_line_length : 0 , ...config } )
70
+ html = html . trim ( )
71
+
72
+ // cheerio output tends to have a bunch of extra newlines. kill them.
73
+ html = html . replace ( / \n \n + / g, "\n\n" )
74
+
75
+ return html
71
76
}
72
77
73
78
/**
@@ -139,11 +144,12 @@ class Styledown {
139
144
process ( raws , options ) {
140
145
return raws . map ( ( raw ) => {
141
146
let $ = Cheerio . load ( raw . html )
147
+ let config = processConfig ( raw . src , options )
148
+ removeConfig ( $ )
149
+
142
150
let highlightHTML = this . highlightHTML . bind ( this )
143
151
let p = this . prefix . bind ( this )
144
152
145
- let config = processConfig ( raw . src , options )
146
- removeConfig ( $ )
147
153
148
154
// let pre = this.options.prefix
149
155
@@ -165,33 +171,32 @@ class Styledown {
165
171
} )
166
172
}
167
173
168
- /**
169
- * prettyprint() : doc.prettyprint(html)
170
- * (private) Reindents given `html` based on the indent size option.
171
- *
172
- * doc.prettyprint('<div><a>hello</a></div>')
173
- * => "<div>\n <a>hello</a>\n</div>"
174
- */
175
-
176
- prettyprint ( html , options ) {
174
+ // no use at the moment
175
+ // /**
176
+ // * prettyprint() : doc.prettyprint(html)
177
+ // * (private) Reindents given `html` based on the indent size option.
178
+ // *
179
+ // * doc.prettyprint('<div><a>hello</a></div>')
180
+ // * => "<div>\n <a>hello</a>\n</div>"
181
+ // */
177
182
178
- let output = html . trim ( )
183
+ // prettyprint() {
184
+ // let html = this.toHTML()
179
185
180
- output = beautifyHTML ( html , options )
186
+ // let config = this.raws.reduce((finalConfig, raw) => {
187
+ // return extend(finalConfig, raw.config)
188
+ // }, this.options)
181
189
182
- // cheerio output tends to have a bunch of extra newlines. kill them.
183
- output = output . replace ( / \n \n + / g, "\n\n" )
184
-
185
- return output
186
- }
190
+ // return beautifyHTML(html, { config })
191
+ // }
187
192
188
193
/**
189
194
* highlightHTML():
190
195
* (private) Syntax highlighting helper
191
196
*/
192
197
193
198
highlightHTML ( html ) {
194
- html = this . prettyprint ( html )
199
+ html = beautifyHTML ( html )
195
200
return hljs . highlight ( 'html' , html ) . value
196
201
}
197
202
@@ -248,6 +253,7 @@ Styledown.parse = function (source, options) {
248
253
return new Styledown ( source , options ) . toHTML ( )
249
254
}
250
255
256
+
251
257
/**
252
258
* Styledown.version:
253
259
* The version number in semver format.
0 commit comments