Skip to content

Commit

Permalink
docs(prism): WTF null as a string
Browse files Browse the repository at this point in the history
  • Loading branch information
ffoodd committed Mar 3, 2022
1 parent f99be7d commit dfb46ec
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions a11y.css.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,13 @@ const parseSassComment = comment => {

const htmlRegex = /(<code class="html language-html">(.[\s\S]+?)<\/code>)/gm
let htmlContent = processedContent.match(htmlRegex)
let processedHTML = prism.highlight(htmlContent, prism.languages.html, 'html')
let processedHTML = prism.highlight(String(htmlContent), prism.languages.html, 'html')
const cssRegex = /(<code class="css language-css">(.[\s\S]+?)<\/code>)/gm
let cssContent = processedContent.match(cssRegex)
let processedCSS = prism.highlight(cssContent, prism.languages.css, 'css')
let processedCSS = prism.highlight(String(cssContent), prism.languages.css, 'css')

processedContent = processedContent.replace(htmlRegex, processedHTML)
processedContent = processedContent.replace(cssRegex, processedCSS)
console.log(processedContent)

return {
attributes: content.attributes,
Expand Down

0 comments on commit dfb46ec

Please sign in to comment.