Skip to content

Parsing Code Fence Parameters causes TypeError #1738

Closed
@V1ncNet

Description

@V1ncNet

Context

I'm using code fence parameters for my pandoc pipeline to render plantuml diagrams using pandoc's diagram filter. Unfortunately, the mandatory syntax ```{#fig:use-cases .plantuml caption="foo"} causes codimd to throw an error while parsing the parameters.

Workaround

Switch to Edit-Mode (by changing the URL's query param to ?edit) and remove the causing line.

Cause

codimd is capable of parsing the expression above, the function is called parseFenceCodeParams. There is a Not-Operator missing that causes the class property to never be initialized. The next line fails due to the uninitialized property.

if (params.class) params.class = []
params.class = params.class.concat(param.slice(1))

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