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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user