Skip to content

Token type paragraph becomes text in master #1247

@vsemozhetbyt

Description

@vsemozhetbyt

Marked version: 0.3.19 master

Markdown flavor: CommonMark ?

Test Script

'use strict';

const marked = require('marked');

const md = `
A Paragraph.

> A blockquote

`;

const tokens = marked.lexer(md);
console.log(tokens);

const html = marked.parser(tokens);
console.log(`\n${html}`);

Expectation

The output from the old version 0.3.6

[ { type: 'paragraph', text: 'A Paragraph.' },
  { type: 'blockquote_start' },
  { type: 'paragraph', text: 'A blockquote' },
  { type: 'blockquote_end' },
  links: {} ]

<p>A Paragraph.</p>
<blockquote>
<p>A blockquote</p>
</blockquote>

Result

The output from the 0.3.19 master:

[ { type: 'text', text: 'A Paragraph.' },
  { type: 'space' },
  { type: 'blockquote_start' },
  { type: 'text', text: 'A blockquote' },
  { type: 'blockquote_end' },
  links: {} ]

<p>A Paragraph.</p>
<blockquote>
<p>A blockquote</p>
</blockquote>

Is this cange intended?

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