dprint / dprint-plugin-markdown

Markdown code formatting plugin for dprint.
MIT License
29 stars 9 forks source link

🐛 Parsing bug for combination of blockquote containing a bullet-list and following text #60

Closed rivy closed 3 years ago

rivy commented 3 years ago

@dsherret , Hello! 👋🏻

I just ran into what appears to be a parsing bug and wanted to let you know about it.

Describe the bug

C:>dprint --version
dprint 0.18.2

C:>cat .dprint.json
{
    "$schema": "https://dprint.dev/schemas/v0.json",
    "projectType": "openSource",
    "incremental": true,
    "indentWidth": 2,
    "lineWidth": 100,
    "useTabs": true,
    "typescript": {
        // ref: <https://dprint.dev/plugins/typescript/config>
        "deno": true,
        // * customize preferences (overrides of some Deno formatting choices)
        // ref: <https://github.com/dprint/dprint-plugin-typescript/blob/44b6cf562e511a308f4a7183dc98fb19cdf21d07/src/configuration/builder.rs#L51>
        // ref: <https://github.com/denoland/deno/blob/f46e39c5c5/cli/tools/fmt.rs#L311>
        "lineWidth": 100,
        "preferSingleLine": true,
        "quoteStyle": "preferSingle",
        //
        "ignoreNodeCommentText": "dprint-ignore", // from Deno's "deno-fmt-ignore"
        "ignoreFileCommentText": "dprint-ignore-file", // from Deno's "deno-fmt-ignore-file"
        "memberExpression.linePerExpression": true,
        "memberExpression.preferSingleLine": true,
        "module.sortImportDeclarations": "caseInsensitive",
        "module.sortExportDeclarations": "caseInsensitive"
    },
    "json": { "preferSingleLine": true },
    "markdown": { "textWrap": "always", "lineWidth": 99999 },
    "prettier": { "printWidth": 100, "singleQuote": true, "tabWidth": 2 },
    "rustfmt": {},
    "includes": ["**/*.{ts,tsx,js,jsx,cjs,mjs,json,md,mkd,rs,yaml,yml}"],
    "excludes": [
        ".history",
        ".changelog/*.tpl.*",
        "CHANGELOG{,.}*",
        "**/node_modules",
        "**/*-lock.json",
        "**/target",
        "**/vendor"
    ],
    "plugins": [
        // ref: <https://plugins.dprint.dev>
        // "https://plugins.dprint.dev/typescript-0.51.0.wasm",
        // "https://plugins.dprint.dev/json-0.12.3.wasm",
        // "https://plugins.dprint.dev/markdown-0.9.5.wasm",
        // "https://plugins.dprint.dev/toml-0.4.1.wasm",
        // // ref: <https://github.com/dprint/dprint-plugin-rustfmt/releases>
        // "https://plugins.dprint.dev/rustfmt-0.4.0.exe-plugin@c6bb223ef6e5e87580177f6461a0ab0554ac9ea6b54f78ea7ae8bf63b14f5bc2",
        // // ref: <https://github.com/dprint/dprint-plugin-prettier/releases>
        // "https://plugins.dprint.dev/prettier-0.2.2.exe-plugin@63b06beba3acd51e6d23379c47db342a1a24f3d88f3c52a775e2db3426124582"
        "https://plugins.dprint.dev/typescript-0.59.0.wasm",
        "https://plugins.dprint.dev/json-0.13.1.wasm",
        "https://plugins.dprint.dev/markdown-0.11.1.wasm",
        "https://plugins.dprint.dev/toml-0.5.2.wasm",
        // ref: <https://github.com/dprint/dprint-plugin-rustfmt/releases>
        "https://plugins.dprint.dev/rustfmt-0.4.0.exe-plugin@c6bb223ef6e5e87580177f6461a0ab0554ac9ea6b54f78ea7ae8bf63b14f5bc2",
        // ref: <https://github.com/dprint/dprint-plugin-prettier/releases>
        "https://plugins.dprint.dev/prettier-0.3.0.exe-plugin@c6c227493e655717b5f3d9c811ba576c82f2b060317bb233c6ec014958fbee19"
    ]
}

Input Code

> - Officia exercitation voluptate ea esse do culpa consequat amet consectetur mollit dolor tempor.
>
> ...

Actual Output

An error occurs during reformatting...

[ERROR] Error formatting text. Line 4, column 1: Unexpected token `>` while parsing link reference definition.

  >
  ~

Let me know if I can be of help tracking down the source of the issue.

dsherret commented 3 years ago

Thanks for reporting @rivy! This is in 0.11.2 (just publishing on CI now).