|
1 | 1 | const liquid = require('./liquid') |
2 | | -const codeHeader = require('./plugins/code-header') |
3 | | -const hubdown = require('hubdown') |
4 | | -const remarkCodeExtra = require('remark-code-extra') |
5 | 2 | const cheerio = require('cheerio') |
6 | 3 | const Entities = require('html-entities').XmlEntities |
7 | 4 | const entities = new Entities() |
8 | 5 | const stripHtmlComments = require('strip-html-comments') |
| 6 | +const createProcessor = require('./create-processor') |
9 | 7 |
|
10 | 8 | // used below to remove extra newlines in TOC lists |
11 | 9 | const endLine = '</a>\r?\n' |
@@ -54,13 +52,9 @@ module.exports = async function renderContent ( |
54 | 52 | // statements so that extra space doesn't mess with list numbering |
55 | 53 | template = template.replace(/(\r?\n){3}/g, '\n\n') |
56 | 54 |
|
57 | | - let { content: html } = await hubdown(template, { |
58 | | - // Disable automatic language guessing in syntax highlighting |
59 | | - highlight: { subset: false }, |
60 | | - runBefore: [[ |
61 | | - remarkCodeExtra, { transform: codeHeader } |
62 | | - ]] |
63 | | - }) |
| 55 | + const processor = createProcessor() |
| 56 | + const vFile = await processor.process(template) |
| 57 | + let html = vFile.toString() |
64 | 58 |
|
65 | 59 | // Remove unwanted newlines (which appear as spaces) from inline tags inside tables |
66 | 60 | if (html.includes('<table>')) html = removeNewlinesFromInlineTags(html) |
|
0 commit comments