(text, opt = {}, next)
| 308 | } |
| 309 | |
| 310 | _renderMain(text, opt = {}, next) { |
| 311 | if (!text) { |
| 312 | return renderMain.call(this, text); |
| 313 | } |
| 314 | |
| 315 | this.callHook('beforeEach', text, result => { |
| 316 | let html; |
| 317 | const callback = () => { |
| 318 | if (opt.updatedAt) { |
| 319 | html = formatUpdated( |
| 320 | html, |
| 321 | opt.updatedAt, |
| 322 | this.config.formatUpdated |
| 323 | ); |
| 324 | } |
| 325 | |
| 326 | this.callHook('afterEach', html, hookData => { |
| 327 | renderMain.call(this, hookData); |
| 328 | next(); |
| 329 | }); |
| 330 | }; |
| 331 | |
| 332 | if (this.isHTML) { |
| 333 | html = this.result = text; |
| 334 | callback(); |
| 335 | } else { |
| 336 | prerenderEmbed( |
| 337 | { |
| 338 | compiler: this.compiler, |
| 339 | raw: result, |
| 340 | }, |
| 341 | tokens => { |
| 342 | html = this.compiler.compile(tokens); |
| 343 | callback(); |
| 344 | } |
| 345 | ); |
| 346 | } |
| 347 | }); |
| 348 | } |
| 349 | |
| 350 | _renderCover(text, coverOnly) { |
| 351 | const el = dom.getNode('.cover'); |
no test coverage detected