Skip to content

how to render post with doubled brackets in codeblock? #5303

Discussion options

You must be logged in to vote

thanks @D-Sketon

const Hexo = require('hexo');

const hexo = new Hexo(__dirname, { silent: true })

const main = async () => {
  await hexo.loadPlugin('hexo-renderers');
  await hexo.loadPlugin('hexo-shortcodes');
  await hexo.init();
  
  const content =   `
  ## below is pretext

  inline codeblock \`build-\${{ hashFiles('package-lock.json') }}\`

  \`\`\`js
  const varx = \`build-\${{ hashFiles('package-lock.json') }}\`
  \`\`\`

  \`\`\`ts
  const xvar = \`build-\${{ hashFiles('package-lock.json') }}\`
  \`\`\`

  \`\`\`
  const var = \`build-\${{ hashFiles('package-lock.json') }}\`
  \`\`\`

  ## below is meta info

  - published: {{ page.date }}
  - modified: {{ page.updated }}
  `

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@dimaslanjaka
Comment options

@dimaslanjaka
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by dimaslanjaka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants