1
0
mirror of synced 2025-12-20 18:36:31 -05:00

Upgrade pipeline with env COMMONMARK=1 npm start to see new, otherwise parse current (#20508)

* Update the trim nightmare

* Update create-processor.js

* Update other packages in the rendering pipeline

* A few more updates

* Fix tables

* Update lint-files.js

* Fix copy code blocks

* Update render-content.js

* remove whitespace from liquid conditionals

* We no longer need require eslint rules

* Neat, it worked

* Revert test change

* Update create-processor.js

* Without aliases

Co-authored-by: Chiedo John <2156688+chiedo@users.noreply.github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>
This commit is contained in:
Kevin Heis
2021-07-29 07:24:26 -07:00
committed by GitHub
parent 648c12948b
commit d68dde17d1
13 changed files with 6090 additions and 4112 deletions

View File

@@ -1,7 +1,7 @@
import h from 'hastscript'
import { h } from 'hastscript'
import octicons from '@primer/octicons'
import parse5 from 'parse5'
import fromParse5 from 'hast-util-from-parse5'
import { fromParse5 } from 'hast-util-from-parse5'
const LANGUAGE_MAP = {
asp: 'ASP',
@@ -94,8 +94,8 @@ export default function addCodeHeader(node) {
const language = LANGUAGE_MAP[node.lang] || node.lang || 'Code'
const btnIconHtml = octicons.clippy.toSVG()
const btnIconAst = parse5.parse(String(btnIconHtml))
const btnIcon = fromParse5(btnIconAst, btnIconHtml)
const btnIconAst = parse5.parse(String(btnIconHtml), { sourceCodeLocationInfo: true })
const btnIcon = fromParse5(btnIconAst, { file: btnIconHtml })
// Need to create the header using Markdown AST utilities, to fit
// into the Unified processor ecosystem.