Skip to content

line_threshold does not work in backtick code block #5158

@D-Sketon

Description

@D-Sketon

Check List

Please check followings before submitting a new issue.

Expected behavior

line_threshold should work in backtick code block

Actual behavior

it doesn't work

How to reproduce?

set config like this

highlight:
  enable: true
  line_number: true
  line_threshold: 5
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: false

write hello-world.md like this(please remove tabs):

    ---
    title: Hello World
    ---
    
    ```java
    public static void main(String[] args) {
        System.out.println("Hello World");
    }
    ```
    
    ```java
    public static void main(String[] args) {
        System.out.println("Hello World");
        System.out.println("Hello World");
        System.out.println("Hello World");
        System.out.println("Hello World");
    }
    ``` 
    
    {% code lang:java %}
    public static void main(String[] args) {
        System.out.println("Hello World");
    }
    {% endcode %}
    
    {% code lang:java %}
    public static void main(String[] args) {
        System.out.println("Hello World");
        System.out.println("Hello World");
        System.out.println("Hello World");
        System.out.println("Hello World");
    }
    {% endcode %}

then line_threshold does not work in backtick code block:
image

Is the problem still there under "Safe mode"?

Environment & Settings

Node.js & npm version(node -v && npm -v)

v18.12.1
8.19.2

Your site _config.yml (Optional)

highlight:
  enable: true
  line_number: true
  line_threshold: 5
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: false

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

Your package.json package.json

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "6.3.0"
  },
  "dependencies": {
    "hexo": "^6.3.0",
    "hexo-generator-archive": "^2.0.0",
    "hexo-generator-category": "^2.0.0",
    "hexo-generator-index": "^3.0.0",
    "hexo-generator-tag": "^2.0.0",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-marked": "^6.0.0",
    "hexo-renderer-stylus": "^2.1.0",
    "hexo-server": "^3.0.0",
    "hexo-theme-landscape": "^0.0.3"
  }
}

Others

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions