Skip to content

This code will cause marked to hang/freeze. #3917

@zWingz

Description

@zWingz

Marked version:
latest
Describe the bug
A clear and concise description of what the bug is.

import { marked } from "marked";
const a = '[\n  {\n    "docid": "4015981857",\n    "title": "磁盘压测",\n    "content": "# 一、创建专用压测目录\\n新建tests磁盘压测专用目录(隔离测试环境)\\n创建固定大小的测试文件(安全边界)\\n验证文件属性\\n# 二、磁盘压测\\n```shell\\nfio --name=root --filename=/data/tests/testfile --rw=randread --size=10G --bs=64k --ioengine=libaio --iodepth=8 --direct=1 --numjobs=1 --runtime=300 --time_based --group_reporting --eta=always\\n```\\n输入完整压测命令\\n```shell\\n--name=root\\n```\\n测试名称\\n```shell\\n--filename=/data/tests/testfile\\n```\\n专用测试文件\\n```shell\\n--rw=randread #read/write/randread/randwrite/randrw\\n```\\n模式                            #顺序读/顺序写/随机读/随机写/混合模式\\n```shell\\n-size=10G\\n```\\n使用整个文件\\n```shell\\n--bs=64k\\n```\\n块大小\\n```shell\\n--ioengine=libaio\\n```\\n异步IO引擎\\n```shell\\n--iodepth=8\\n```\\nIO队列深度\\n```shell\\n-direct=1\\n```\\n直写磁盘\\n```shell\\n--numjobs=1\\n```\\n并发任务数\\n```shell\\n--runtime=300\\n```\\n运行时间\\n```shell\\n--time_based\\n```\\n保证运行时间\\n```shell\\n-group_reporting\\n```\\n汇总报告\\n```shell\\n--output=/data/fio_'
console.log(a);

const rendered = marked.parse(`${a}`, {
    // gfm: true,
    // breaks: true,
})
console.log(rendered);

To Reproduce
Steps to reproduce the behavior:

Expected behavior
A clear and concise description of what you expected to happen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    L1 - brokenValid usage causes incorrect output OR a crash AND there is no known workaround for the issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions