Skip to content
Permalink
Browse files

fix: regression of escape html in code

  • Loading branch information...
ulivz committed Apr 5, 2019
1 parent d6465fb commit 8f638e3662141473ec0882fce5a2e67496e59ca1
Showing with 5 additions and 3 deletions.
  1. +3 −2 lib/html.js
  2. +2 −1 package.json
@@ -4,6 +4,7 @@

const cheerio = require('cheerio')
const compose = require('./compose')
const escapeHtml = require('escape-html')

/**
* Expose a object containing the utilities of handling markups.
@@ -66,8 +67,8 @@ function highlight($) {

function escapeHTMLTagInCode($) {
$('code').replaceWith((i, el) => {
const content = el.text()
return escape(content)
const content = $(el).text()
return `<code>${escape(content)}</code>`
})
return $
}
@@ -37,7 +37,8 @@
"lint-staged": "8.1.0",
"release-it": "v7.4.8",
"vuepress": "1.0.0-alpha.44",
"xo": "0.23.0"
"xo": "0.23.0",
"escape-html": "^1.0.3"
},
"jest": {
"testEnvironment": "node"

0 comments on commit 8f638e3

Please sign in to comment.
You can’t perform that action at this time.