hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
38.96k stars 4.78k forks source link

{ } in code blocks convert to { and } #4385

Closed dumindu closed 4 years ago

dumindu commented 4 years ago

Question

Screenshot 2020-06-28 at 12 17 23 PM

Environment & Settings

Node.js & npm version

v14.4.0
6.14.4

Your site _config.yml (Optional)

title: Learning Rust
subtitle: "Rust Programming Language Tutorials"
description: "Rust Programming Language Tutorials"
author: Dumindu Madunuwan
language: en
timezone: UTC

url: https://learning-rust.github.io
root: /

theme: navy

deploy:
  type: git
  repo: git@github.com:learning-rust/learning-rust.github.io.git

highlight:
  enable: false

hljs:
  enable: true

Hexo and Plugin version(npm ls --depth 0)

├── cheerio@0.22.0
├── eslint@7.3.1
├── eslint-config-hexo@4.1.0
├── hexo@4.2.0 (github:hexojs/hexo#65961d328192e948586dd3c2a2b856173c628ef0)
├── hexo-clean-css@1.0.0
├── hexo-deployer-git@2.1.0
├── hexo-filter-nofollow@2.0.2
├── hexo-fs@3.1.0
├── hexo-generator-sitemap@2.0.0
├── hexo-renderer-marked@2.0.0
├── hexo-renderer-pug@1.0.0
├── hexo-renderer-stylus@1.1.0
├── hexo-renderer-swig@1.1.0
├── hexo-server@1.0.0
├── hexo-uglify@1.1.0
├── husky@4.2.5
├── imagemin-lint-staged@0.4.0
├── lint-staged@10.2.11
├── lunr@2.3.8
└── sharp@0.25.4

Your package.json package.json

{
  "name": "learning-rust.github.io",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "4.2.0"
  },
  "scripts": {
    "build": "hexo generate",
    "eslint": "eslint .",
    "deploy": "hexo deploy"
  },
  "dependencies": {
    "cheerio": "^0.22.0",
    "hexo": "hexojs/hexo",
    "hexo-clean-css": "^1.0.0",
    "hexo-deployer-git": "^2.1.0",
    "hexo-filter-nofollow": "^2.0.2",
    "hexo-fs": "^3.1.0",
    "hexo-generator-sitemap": "^2.0.0",
    "hexo-renderer-marked": "^2.0.0",
    "hexo-renderer-pug": "^1.0.0",
    "hexo-renderer-stylus": "^1.0.0",
    "hexo-renderer-swig": "^1.1.0",
    "hexo-server": "^1.0.0",
    "hexo-uglify": "^1.0.0",
    "lunr": "2.3.8",
    "sharp": "^0.25.2"
  },
  "devDependencies": {
    "eslint": "^7.0.0",
    "eslint-config-hexo": "^4.0.0",
    "husky": "^4.0.7",
    "imagemin-lint-staged": "^0.4.0",
    "lint-staged": "^10.2.2"
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{png,jpeg,jpg,gif,svg}": [
      "imagemin-lint-staged",
      "git add"
    ]
  },
  "engines": {
    "node": ">=8.10.0"
  }
}

Thanks

stevenjoezhang commented 4 years ago

See also https://github.com/hexojs/hexo/pull/4362

SukkaW commented 4 years ago

@dumindu

Is the page here that went wrong?

https://github.com/learning-rust/site/blob/b24e78a792adea28bf8169863c0ab23cf7cb746c/source/docs/a7.functions.md

I am not sure whether the issue has been fixed or not (we lost the track of it), so I will add a test case specific for your issue.

dumindu commented 4 years ago

Thanks @stevenjoezhang @SukkaW for the verification. I am not good at node and js. It looks like,

npm install hexo-cli -g
npm install

sets "hexo": {"version": "4.2.0"}, on package.json, even I set it to v.4.2.1 before running above commands.

env : macOS, tested with both node and nvm;(brew install); after uninstall all related to node and hexo ; (Node v14.5.0 & v12.18.2)

However in a one attempt with nvm node 12.18.2 I could stick with hexo v.4.2.1 and could deploy stuff to my site by changing "dependencies": { "hexo": "hexojs/hexo", ...} to"dependencies": { "hexo": "^4.2.1", ...}` in the package.json.

{
  "name": "learning-rust.github.io",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "4.2.1"
  },
  "scripts": {
    "build": "hexo generate",
    "eslint": "eslint .",
    "deploy": "hexo deploy"
  },
  "dependencies": {
    "cheerio": "^0.22.0",
    "hexo": "^4.2.1",
    "hexo-clean-css": "^1.0.0",
    "hexo-deployer-git": "^2.1.0",
    "hexo-filter-nofollow": "^2.0.2",
    "hexo-fs": "^3.1.0",
    "hexo-generator-sitemap": "^2.0.0",
    "hexo-renderer-marked": "^3.0.0",
    "hexo-renderer-pug": "^1.0.0",
    "hexo-renderer-stylus": "^1.0.0",
    "hexo-renderer-swig": "^1.1.0",
    "hexo-server": "^1.0.0",
    "hexo-uglify": "^1.0.0",
    "lunr": "2.3.8",
    "sharp": "^0.25.2"
  },
  "devDependencies": {
    "eslint": "^7.0.0",
    "eslint-config-hexo": "^4.0.0",
    "husky": "^4.0.7",
    "imagemin-lint-staged": "^0.4.0",
    "lint-staged": "^10.2.2"
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{png,jpeg,jpg,gif,svg}": [
      "imagemin-lint-staged",
      "git add"
    ]
  },
  "engines": {
    "node": ">=8.10.0"
  }
}

Looks like some issue on my side. Thanks again for the verification.