括号无法在hexo博客中正确显示

问题描述

我试图使用Github页面和hexo建立个人博客。我正在使用主题主题。但是,无法在hexo博客中正确显示代码区域中的方括号。而是显示为{。我不确定我做了什么更改。 现在的代码如下所示。

public class Client {
    public static void main() {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();        
        DataOutputStream dos = new DataOutputStream(baos);
        dos.writeInt(1);

我不熟悉前端问题,而且我不知道自己做了什么更改。我曾经怀疑/node_modules/marked/lib/marked.js出了问题。但是,我去https://github.com/markedjs/marked/tree/master/lib下载了一个新的。它仍然不起作用。有人可以帮我吗?

marked.js中的内联部分

  var inline = {
    escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,// escape: /^\\([`*\[\]()#$+\-.!_>])/,autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url: noopTest$1,tag: '^comment' + '|^</[a-zA-Z][\\w:-]*\\s*>' // self-closing tag
    + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag
    + '|^<\\?[\\s\\S]*?\\?>' // processing instruction,e.g. <?php ?>
    + '|^<![a-zA-Z]+\\s[\\s\\S]*?>' // declaration,e.g. <!DOCTYPE html>
    + '|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>',// CDATA section
    link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch: 'reflink|nolink(?!\\()',strong: {
      start: /^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,// (1) returns if starts w/ punctuation
      middle: /^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst: /[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,// last char can't be punct,or final * must also be followed by punct (or endline)
      endUnd: /[^\s]__(?!_)(?:(?=[punctuation\s])|$)/ // last char can't be a space,and final _ must preceed punct or \s (or endline)

    },em: {
      start: /^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,// (1) returns if starts w/ punctuation
      middle: /^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst: /[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,or final * must also be followed by punct (or endline)
      endUnd: /[^\s]_(?!_)(?:(?=[punctuation\s])|$)/ // last char can't be a space,and final _ must preceed punct or \s (or endline)
    },code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br: /^( {2,}|\\)\n(?!\s*$)/,del: noopTest$1,text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation: /^([\s*punctuation])/
  }; // list of punctuation marks from common mark spec
  // without * and _ to workaround cases with double emphasis

解决方法

https://github.com/hexojs/hexo/issues/4501

// node_modules/hexo_prism_plugin/src/index.js
// L8-L14
const map = {
  '&#39;': '\'','&amp;': '&','&gt;': '>','&lt;': '<','&quot;': '"'
};

一种解决方法是

const map = {
  '&#39;': '\'','&quot;': '"','&#123;': '{','&#125;': '}'
};

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...