Skip to content

deno test --doc fails if the code is inside a blockquote #25980

Description

@lowlighter

If you embed an example inside a blockquote (>) then it cannot be parsed and errors (it treats the > of the code blocks as part of the source code).

/**
 * Documentation of my function.
 *
 * > [!WARNING]
 * > This is inside a warning block.
 * >
 * > ```ts
 * > function foo() {
 * >   return "bar"
 * > }
 * > ```
 */
export function foo() {
  return "bar"
}
vscode ➜ /workspaces/deno$ deno test --doc -A test.ts 
error: Expression expected at file:///workspaces/deno/test.ts$7-12.ts:2:5

  >   return "bar"
      ~~~~~~

vscode ➜ /workspaces/deno$ deno --version
deno 2.0.0-rc.9 (release candidate, release, x86_64-unknown-linux-gnu)
v8 12.9.202.13-rusty
typescript 5.6.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working correctlytestingrelated to deno test and coverage

    Type

    Fields

    No fields configured for bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions