Giter Club home page Giter Club logo

micromark-extension-gfm-table's Introduction

micromark-extension-gfm-table

Build Coverage Downloads Size Sponsors Backers Chat

micromark extensions to support GFM tables.

Contents

What is this?

This package contains extensions that add support for the table syntax enabled by GFM to micromark. These extensions match github.com.

When to use this

This project is useful when you want to support tables in markdown.

You can use these extensions when you are working with micromark. To support all GFM features, use micromark-extension-gfm instead.

When you need a syntax tree, combine this package with mdast-util-gfm-table.

All these packages are used in remark-gfm, which focusses on making it easier to transform content by abstracting these internals away.

Install

This package is ESM only. In Node.js (version 16+), install with npm:

npm install micromark-extension-gfm-table

In Deno with esm.sh:

import {gfmTable, gfmTableHtml} from 'https://esm.sh/micromark-extension-gfm-table@2'

In browsers with esm.sh:

<script type="module">
  import {gfmTable, gfmTableHtml} from 'https://esm.sh/micromark-extension-gfm-table@2?bundle'
</script>

Use

import {micromark} from 'micromark'
import {gfmTable, gfmTableHtml} from 'micromark-extension-gfm-table'

const output = micromark('| a |\n| - |', {
  extensions: [gfmTable()],
  htmlExtensions: [gfmTableHtml()]
})

console.log(output)

Yields:

<table>
<thead>
<tr>
<th>a</th>
</tr>
</thead>
</table>

API

This package exports the identifiers gfmTable and gfmTableHtml. There is no default export.

The export map supports the development condition. Run node --conditions development module.js to get instrumented dev code. Without this condition, production code is loaded.

gfmTable()

Create an HTML extension for micromark to support GitHub tables syntax.

Returns

Extension for micromark that can be passed in extensions to enable GFM table syntax (Extension).

gfmTableHtml()

Create an HTML extension for micromark to support GitHub tables when serializing to HTML.

Returns

Extension for micromark that can be passed in htmlExtensions to support GFM tables when serializing to HTML (HtmlExtension).

Bugs

GitHub’s own algorithm to parse tables contains a bug. This bug is not present in this project. The issue relating to tables is:

Authoring

When authoring markdown with GFM tables, it’s recommended to always put pipes around cells. Without them, it can be hard to infer whether the table will work, how many columns there are, and which column you are currently editing.

It is recommended to not use many columns, as it results in very long lines, making it hard to infer which column you are currently editing.

For larger tables, particularly when cells vary in size, it is recommended not to manually “pad” cell text. While it can look better, it results in a lot of time spent realigning everything when a new, longer cell is added or the longest cell removed, as every row then must be changed. Other than costing time, it also causes large diffs in Git.

To illustrate, when authoring large tables, it is discouraged to pad cells like this:

| Alpha bravo charlie |              delta |
| ------------------- | -----------------: |
| Echo                | Foxtrot golf hotel |

Instead, use single spaces (and single filler dashes):

| Alpha bravo charlie | delta |
| - | -: |
| Echo | Foxtrot golf hotel |

HTML

GFM tables relate to several HTML elements: <table>, <tbody>, <td>, <th>, <thead>, and <tr>. See § 4.9.1 The table element, § 4.9.5 The tbody element, § 4.9.9 The td element, § 4.9.10 The th element, § 4.9.6 The thead element, and § 4.9.8 The tr element in the HTML spec for more info.

If the alignment of a column is left, right, or center, a deprecated align attribute is added to each <th> and <td> element belonging to that column. That attribute is interpreted by browsers as if a CSS text-align property was included, with its value set to that same keyword.

CSS

The following CSS is needed to make tables look a bit like GitHub. For the complete actual CSS see sindresorhus/github-markdown-css

/* Light theme. */
:root {
  --color-canvas-default: #ffffff;
  --color-canvas-subtle: #f6f8fa;
  --color-border-default: #d0d7de;
  --color-border-muted: hsla(210, 18%, 87%, 1);
}

/* Dark theme. */
@media (prefers-color-scheme: dark) {
  :root {
    --color-canvas-default: #0d1117;
    --color-canvas-subtle: #161b22;
    --color-border-default: #30363d;
    --color-border-muted: #21262d;
  }
}

table {
  border-spacing: 0;
  border-collapse: collapse;
  display: block;
  margin-top: 0;
  margin-bottom: 16px;
  width: max-content;
  max-width: 100%;
  overflow: auto;
}

tr {
  background-color: var(--color-canvas-default);
  border-top: 1px solid var(--color-border-muted);
}

tr:nth-child(2n) {
  background-color: var(--color-canvas-subtle);
}

td,
th {
  padding: 6px 13px;
  border: 1px solid var(--color-border-default);
}

th {
  font-weight: 600;
}

table img {
  background-color: transparent;
}

Syntax

Tables form with the following BNF:

gfm_table ::= gfm_table_head 0*(eol gfm_table_body_row)

; Restriction: both rows must have the same number of cells.
gfm_table_head ::= gfm_table_row eol gfm_table_delimiter_row

gfm_table_row ::= ['|'] gfm_table_cell 0*('|' gfm_table_cell) ['|'] *space_or_tab
gfm_table_cell ::= *space_or_tab gfm_table_text *space_or_tab
gfm_table_text ::= 0*(line - '\\' - '|' | '\\' ['\\' | '|'])

gfm_table_delimiter_row ::= ['|'] gfm_table_delimiter_cell 0*('|' gfm_table_delimiter_cell) ['|'] *space_or_tab
gfm_table_delimiter_cell ::= *space_or_tab gfm_table_delimiter_value *space_or_tab
gfm_table_delimiter_value ::= [':'] 1*'-' [':']

As this construct occurs in flow, like all flow constructs, it must be followed by an eol (line ending) or eof (end of file).

The above grammar shows that basically anything can be a cell or a row. The main thing that makes something a row, is that it occurs directly before or after a delimiter row, or after another row.

It is not required for a table to have a body: it can end right after the delimiter row.

Each column can be marked with an alignment. The alignment marker is a colon (:) used before and/or after delimiter row filler. To illustrate:

| none | left | right | center |
| ---- | :--- | ----: | :----: |

The number of cells in the delimiter row, is the number of columns of the table. Only the head row is required to have the same number of cells. Body rows are not required to have a certain number of cells. For body rows that have less cells than the number of columns of the table, empty cells are injected. When a row has more cells than the number of columns of the table, the superfluous cells are dropped. To illustrate:

| a | b |
| - | - |
| c |
| d | e | f |

Yields:

<table>
<thead>
<tr>
<th>a</th>
<th>b</th>
</tr>
</thead>
<tbody>
<tr>
<td>c</td>
<td></td>
</tr>
<tr>
<td>d</td>
<td>e</td>
</tr>
</tbody>
</table>

Each cell’s text is interpreted as the text content type. That means that it can include constructs such as attention (emphasis, strong).

The grammar for cells prohibits the use of | in them. To use pipes in cells, encode them as a character reference or character escape: &vert; (or &VerticalLine;, &verbar;, &#124;, &#x7c;) or \|.

Escapes will typically work, but they are not supported in code (text) (and the math (text) extension). To work around this, GitHub came up with a rather weird “trick”. When inside a table cell and inside code, escaped pipes are decoded. To illustrate:

| Name | Character |
| - | - |
| Left curly brace | `{` |
| Pipe | `\|` |
| Right curly brace | `}` |

Yields:

<table>
<thead>
<tr>
<th>Name</th>
<th>Character</th>
</tr>
</thead>
<tbody>
<tr>
<td>Left curly brace</td>
<td><code>{</code></td>
</tr>
<tr>
<td>Pipe</td>
<td><code>|</code></td>
</tr>
<tr>
<td>Right curly brace</td>
<td><code>}</code></td>
</tr>
</tbody>
</table>

👉 Note: no other character can be escaped like this. Escaping pipes in code does not work when not inside a table, either.

Types

This package is fully typed with TypeScript. It exports no additional types.

Compatibility

Projects maintained by the unified collective are compatible with maintained versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of Node. This means we try to keep the current release line, micromark-extension-gfm-table@^2, compatible with Node.js 16.

This package works with micromark version 3 and later.

Security

This package is safe.

Related

Contribute

See contributing.md in micromark/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer

micromark-extension-gfm-table's People

Contributors

shlroland avatar wooorm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

micromark-extension-gfm-table's Issues

Cannot render table

Initial checklist

Affected packages and versions

2.0.0

Link to runnable example

https://codepen.io/nguyen-dinh-hai-dang/pen/QWoJaza

Steps to reproduce

The code in codepen works, but when I apply the code to my markdown editor, when I type the formula to create the table, the web page disappears, and I have to F5 to return to the original web page, and the part I wrote. is then erased.

Expected behavior

Print the table

Actual behavior

The web disappear, and I have to F5 to return to the original web page.

image

image

Runtime

Node v16

Package manager

npm v7

OS

Windows

Build and bundle tools

Create React App

Parsing fails when disabling construct `codeIndented` (using `micromark-extension-mdx-md`)

Initial checklist

Affected packages and versions

[email protected]

Link to runnable example

https://codepen.io/tumidi/pen/GRXaMwZ

Steps to reproduce

Create a project with remark-mdx together with remark-gfm and use indentation inside JSX tags. micromark-extension-mdx-md will disable construct codeIndented which leads to this behavior. The bug report originates from this discussion.

Expected behavior

Tables should render independent of indentation level.

Actual behavior

Tables don't render for indentations with 4 spaces or larger.

Runtime

Node v16

Package manager

Other (please specify in steps to reproduce)

OS

Linux

Build and bundle tools

Vite

Table Content is Including Markdown Header when Between Two Tables

Initial checklist

Affected packages and versions

micromark-extension-gfm-table ^2.0.0

Link to runnable example

https://codesandbox.io/s/relaxed-orla-9wkxgi?file=/src/index.js

Steps to reproduce

I am using remark-gfm in order to help parse some markdown, but it seems that it is coming up with some results that I am not expecting.

Here is the markdown I am parsing:

# Table 1
| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| foo      | bar      | blob     |
| baz      | qux      | trust    |
| quux     | quuz     | glob     |
# Table 2
| Column 1 | Column 2 |
|----------|----------|
| foo      | bar      |
| baz      | qux      |
| quux     | quuz     |

New paragraph.
I am looking for just the tables present. I expect the results to include 2 tables, but for some reason I am only getting one table output.

Please let me know if I am doing something wrong or if this is the intended functionality.

This is what npm version outputs:

{
  npm: '8.5.5',
  node: '16.15.0',
  v8: '9.4.146.24-node.20',
  uv: '1.43.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.18.1',
  modules: '93',
  nghttp2: '1.47.0',
  napi: '8',
  llhttp: '6.0.4',
  openssl: '1.1.1n+quic',
  cldr: '40.0',
  icu: '70.1',
  tz: '2021a3',
  unicode: '14.0',
  ngtcp2: '0.1.0-DEV',
  nghttp3: '0.1.0-DEV'
}

Expected behavior

I expect to get 2 tables:

| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| foo      | bar      | blob     |
| baz      | qux      | trust    |
| quux     | quuz     | glob     |

and

| Column 1 | Column 2 |
|----------|----------|
| foo      | bar      |
| baz      | qux      |
| quux     | quuz     |

Actual behavior

The result I get for the table hits in terms of the actual text is:

| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| foo      | bar      | blob     |
| baz      | qux      | trust    |
| quux     | quuz     | glob     |
# Table 2
| Column 1 | Column 2 |
|----------|----------|
| foo      | bar      |
| baz      | qux      |
| quux     | quuz     |

Runtime

Node v16

Package manager

Other (please specify in steps to reproduce)

OS

Linux

Build and bundle tools

Rollup

severe performance issues with certain inputs

Initial checklist

Affected packages and versions

micromark-extension-gfm-table 1.0.5

Link to runnable example

No response

Steps to reproduce

we're using remark-gfm as part of our markdown parsing stack on a deployed site which accepts user markdown, and by bisecting the parsing stack, we've noticed that certain inputs of similar size and content cause micromark-extension-gfm-table to run 120-fold slower.

minimized test case:

import fs from "fs";
import { micromark } from "micromark";
import { gfmTable, gfmTableHtml } from "micromark-extension-gfm-table";

const md = fs.readFileSync(process.argv[2]);

const output = micromark(md, {
	extensions: [gfmTable],
	htmlExtensions: [gfmTableHtml],
});

console.log(output);

inputs that reproduce this issue:
bee-movie-repro.md

inputs that do not reproduce this issue:
bee-movie-no-repro-2.md
bee-movie-no-repro.md

Expected behavior

$ time node main.mjs /mnt/c/Users/vogon/Downloads/bee-movie-no-repro.md > /dev/null
node main.mjs /mnt/c/Users/vogon/Downloads/bee-movie-no-repro.md > /dev/null  0.16s user 0.02s system 132% cpu 0.135 total

$ time node main.mjs /mnt/c/Users/vogon/Downloads/bee-movie-no-repro-2.md > /dev/null
node main.mjs /mnt/c/Users/vogon/Downloads/bee-movie-no-repro-2.md > /dev/nul  0.37s user 0.04s system 166% cpu 0.247 total

edit to add: also, after removing gfmTable and gfmTableHtml from the list of extensions in the call to micromark():

$ time node main.mjs /mnt/c/Users/vogon/Downloads/bee-movie-repro.md > /dev/null
node main.mjs /mnt/c/Users/vogon/Downloads/bee-movie-repro.md > /dev/null  0.20s user 0.00s system 124% cpu 0.160 total

Actual behavior

$ time node main.mjs /mnt/c/Users/vogon/Downloads/bee-movie-repro.md > /dev/null
node main.mjs /mnt/c/Users/vogon/Downloads/bee-movie-repro.md > /dev/null  36.33s user 3.80s system 204% cpu 19.579 total

Runtime

Node v14

Package manager

pnpm

OS

Linux

Build and bundle tools

No response

Very slow to parse for large tables (> 200 rows)

Initial checklist

Affected packages and versions

micromark-extension-gfm-table 1.0.5

Link to runnable example

https://codesandbox.io/s/patient-pond-uvq9jd

Steps to reproduce

https://codesandbox.io/s/patient-pond-uvq9jd

Expected behavior

When using remark without micromark (an old version), the table is parsed and rendered in less than 1 seconds

Actual behavior

The table (which is not very big - only 450 rows) takes ~10 seconds to parse

Runtime

Node v14

Package manager

yarn v2

OS

macOS

Build and bundle tools

Create React App

Some c0 characters cause a crash

Subject of the issue

Some short inputs produce RangeError: Maximum call stack size exceeded errors

Your environment

  • OS: Ubuntu
  • Packages: micromark-extension-gfm 0.1.0, micromark 2.6.0
  • Env: node 14

Steps to reproduce

discovered using micromark/micromark#18

var fs = require('fs')
var micromark = require('micromark')
var gfmSyntax = require('micromark-extension-gfm')
var gfmHtml = require('micromark-extension-gfm/html')

var doc = fs.readFileSync('<one of the crash files goes here>')

var result = micromark(doc, {
  allowDangerousHtml: true,
  extensions: [gfmSyntax()],
  htmlExtensions: [gfmHtml]
})

console.log(result)

Run any of the attached files through to reproduce the issue

crash-5ea430ec94fc2ad0111b7a93902717954c33aee70c4580157e2e33f1233b771f.txt
crash-8d29501e5df33f9267a4c3e5756c3f064b02ac17b1a94dd9fed3864065cac8f7.txt
crash-18fa9164e99eede7aef9a4b132dfd102c63af51f5281a5e65f62d7f8a05da2c2.txt
crash-44ddd3dab072ad531b8d1d8bf1de45d1434239863e92eb11e24376a2250833bd.txt
crash-61c581437cca1b8a729dbc7785c87c990a15e64246bc38177a47299817f410d6.txt
crash-199c3bd460de84b1e70363da216e177a93d918f6e4ba3abb485f961ca8f5d20d.txt
crash-0986c194573a3b25288270e3238197192b2c5e16780905f85e6b5d307de17030.txt
crash-3647cb12a83367983354b6aa65573a230990070507444681e6d3c4c19c3d1f8d.txt
crash-a00f61d5c6ccbd0fa0f439bd59fe31ebdaa62dd5fa18bc7a40b6a78df0362220.txt
crash-c89af552ec529a6276432019ad8f404aa630dc590de696c1c164aa1baec4b3a0.txt
crash-d5f7abcafb561be96fb5af1839cd54a47303216105afa9477d072d7fcdc5d6fd.txt

Expected behavior

micromark should not crash

Actual behavior

RangeError: Maximum call stack size exceeded
    at assign (<anonymous>)
    at shallow (/micromark/dist/util/shallow.js:1:1131)
    at now (/micromark/dist/util/create-tokenizer.js:1:21524)
    at Object.enter (/micromark/dist/util/create-tokenizer.js:1:24223)
    at cellBreakHead (/micromark/node_modules/micromark-extension-gfm-table/syntax.js:1:46598)
    at inCellContentHead (/micromark/node_modules/micromark-extension-gfm-table/syntax.js:1:47495)
    at cellBreakHead (/micromark/node_modules/micromark-extension-gfm-table/syntax.js:1:46663)
    at inCellContentHead (/micromark/node_modules/micromark-extension-gfm-table/syntax.js:1:47495)
    at cellBreakHead (/micromark/node_modules/micromark-extension-gfm-table/syntax.js:1:46663)
    at inCellContentHead (/micromark/node_modules/micromark-extension-gfm-table/syntax.js:1:47495)

Flow can interrupt tables

Initial checklist

Affected packages and versions

latest

Link to runnable example

No response

Steps to reproduce

| a |
| - |
| b |
> block quote?

| a |
| - |
| b |
- list?

| a |
| - |
| b |
<div>html?</div>

| a |
| - |
| b |
# atx heading

| a |
| - |
| b |
    indented code?

| a |
| - |
| b |
```js
fenced code?
```

| a |
| - |
| b |
***

^-- thematic break

| a |
| - |
| b |
paragraph?

| a |
| - |
| b |
[x]: definition

| a |
| - |
| b |
setext heading
===

Expected behavior

a
b

block quote?

a
b
  • list?
a
b
html?
a
b

atx heading

a
b
indented code?
a
b
fenced code?
a
b

^-- thematic break

a
b
paragraph?
a
b
[x]: definition
a
b
setext heading
===

Actual behavior

syntax-tree/unist#57

Runtime

No response

Package manager

No response

OS

No response

Build and bundle tools

No response

Parsing fails when newline characters are present

Initial checklist

Affected packages and versions

micromark-extension-gfm-table@^1.0.0

Link to runnable example

https://codesandbox.io/s/remark-debug-forked-q95c5?file=/src/index.js

Steps to reproduce

Feed the following markdown into remark-gfm:

- [x] Task 1
    

or to be more clear (note the whitespace):

- [x] Task 1\n    

I can't quite figure out the exact condition for this. Seems like the presence of a line break (\n) somewhere in the input causes the crash. At the end -- definitely crash. At the start -- sometimes crash.

Expected behavior

Properly parsed response, ie. * Task 1

Actual behavior

micromark-extension-gfm-table crashes with TypeError: Cannot read property '3' of undefined.

Full stack trace:

syntax.js:587 Uncaught TypeError: Cannot read property '3' of undefined
    at lineStart (syntax.js:587)
    at go (create-tokenizer.js:136)
    at main (create-tokenizer.js:127)
    at Object.write (create-tokenizer.js:70)
    at continueFlow (document.js:119)
    at flowContinue (document.js:91)
    at go (create-tokenizer.js:136)
    at main (create-tokenizer.js:130)
    at Object.write (create-tokenizer.js:70)
    at fromMarkdown (index.js:26)

Failing line:

    function lineStart(code) {
      return self.parser.lazy[self.now().line] ? nok(code) : ok(code)
    }

Runtime

Google Chrome

Package manager

yarn v1

OS

macOS

Build and bundle tools

Webpack

problem about parsing empty cell without any whitespaces

Initial checklist

Affected packages and versions

1.0.2

Link to runnable example

No response

Steps to reproduce

micromark-extension-gfm-table doesn't seem to generate any events corresponding to empy cell which has no whitespace, like:

|a|b|c|
|-|-|-|
|1|2|3|
|1||3|

In remark layer, here is PoC:

import { unified } from "unified";
import remarkParse from "remark-parse";
import remarkGfm from "remark-gfm";
import remarkRehype from "remark-rehype";
import remarkStringify from "rehype-stringify";

const processor = unified()
  .use(remarkParse)
  .use(remarkGfm)
  .use(remarkRehype)
  .use(remarkStringify);

const md = `
|a|b|c|
|-|-|-|
|1|2|3|
|1||3|
`;

processor.process(md).then((result) => {
  console.log(result.value);
});

I checked mdast tree and generated events, and found there's no event which corresponds to empty cell.

[ 'enter', 'tableRow', '|1||3|' ]
[ 'enter', 'tableData', '|1|' ]
[ 'enter', 'tableCellDivider', '|' ]
[ 'exit', 'tableCellDivider', '|' ]
[ 'enter', 'tableContent', '1' ]
[ 'enter', 'chunkText', '1' ]
[ 'exit', 'chunkText', '1' ]
[ 'exit', 'tableContent', '1' ]
[ 'enter', 'tableCellDivider', '|' ]
[ 'exit', 'tableCellDivider', '|' ]
[ 'exit', 'tableData', '|1|' ]
[ 'enter', 'tableData', '|3|' ]
[ 'enter', 'tableCellDivider', '|' ]
[ 'exit', 'tableCellDivider', '|' ]
[ 'enter', 'tableContent', '3' ]
[ 'enter', 'chunkText', '3' ]
[ 'exit', 'chunkText', '3' ]
[ 'exit', 'tableContent', '3' ]
[ 'enter', 'tableCellDivider', '|' ]
[ 'exit', 'tableCellDivider', '|' ]
[ 'exit', 'tableData', '|3|' ]
[ 'exit', 'tableRow', '|1||3|' ]

Expected behavior

GitHub produces the following HTML.
I expect micromark-extension-gfm-table (or mdast-gfm-table or remark-gfm) would do.

<table>
<thead>
<tr>
<th>a</th>
<th>b</th>
<th>c</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>1</td>
<td></td>
<td>3</td>
</tr>
</tbody>
</table>

Actual behavior

The following html is generated.

<table>
<thead>
<tr>
<th>a</th>
<th>b</th>
<th>c</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>1</td>
<td>3</td>
<td></td>
</tr>
</tbody>
</table>

Runtime

Node v16

Package manager

npm v7

OS

Linux

Build and bundle tools

No response

Using `micromark-extension-definition-list` does not work if `micromark-extension-gfm-table` is used

Initial checklist

Affected packages and versions

(latest) remark v14.0.2, remark-gfm v3.0.1, remark-definition-list v1.2.0, remark-rehype v10.1.0

Link to runnable example

https://stackblitz.com/edit/typescript-yj7hye?file=index.ts,index.html

Steps to reproduce

Using unified with remark-gfm and remark-definition-list, compiling with rehype.

It does not matter what is used first: remarkGfm or remarkDefinitionList.

The output of remark looks correct, but not the HTML when using unified.

The example contains one gfm with gfm-table plugin (1:1 copy from repo) and one without it, when gfm-table is not used, it works correct.


as not possible to select:

Package manager: NPM v8

Build and bundle tools: none, plain ESM

Expected behavior

No impact of micromark-extension-gfm-table when using the definition list syntax:

First Term
: This is the definition of the first term.

Second Term
: This is one definition of the second term.
: This is another definition of the second term.

Like GitHub, e.g. just not handling it:

First Term
: This is the definition of the first term.

Second Term
: This is one definition of the second term.
: This is another definition of the second term.


This HTML is expected:

<dl>
<dt>First Term</dt>
<dd>This is the definition of the first term.
</dd>
<dt>Second Term</dt>
<dd>This is one definition of the second term.
</dd>
<dd>This is another definition of the second term.
</dd>
</dl>

Actual behavior

When using micromark-extension-gfm-table it forces, without that plugin it defaults to be compiled to HTML:

<p>First Term
: This is the definition of the first term.</p>
<p>Second Term
: This is one definition of the second term.
: This is another definition of the second term.</p>

Whereas GitHub creates:

<p>First Term<br>
: This is the definition of the first term.</p>
<p>Second Term<br>
: This is one definition of the second term.<br>
: This is another definition of the second term.</p>

Runtime

Node v14

Package manager

Other (please specify in steps to reproduce)

OS

Windows, Linux

Build and bundle tools

Other (please specify in steps to reproduce)

Delimiter-like body row stops parsing

Initial checklist

Affected packages and versions

latest

Link to runnable example

https://stackblitz.com/edit/typescript-3aqowy?file=index.ts,index.html

Steps to reproduce

a
:-
--
b

Expected behavior

One table:

a
--
b

Actual behavior

a is a paragraph, then there is a table

Runtime

No response

Package manager

No response

OS

No response

Build and bundle tools

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.