Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
4 tasks done
tumidi opened this issue Apr 1, 2023 · 3 comments
Closed
4 tasks done
Labels
💪 phase/solved Post is done

Comments

@tumidi
Copy link

tumidi commented Apr 1, 2023

Initial checklist

Affected packages and versions

micromark-extension-gfm-table@1.0.5

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

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Apr 1, 2023
@wooorm wooorm added the 👍 phase/yes Post is accepted and can be worked on label Apr 3, 2023
@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Apr 3, 2023
@github-actions

This comment has been minimized.

@wooorm
Copy link
Member

wooorm commented May 10, 2023

I verified that this now works since 9033e98.

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

const doc = `
<div>
  | a |
  | - |
  | b |
</div>

<div>
  <div>
    | a |
    | - |
    | b |
  </div>
</div>
`

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

console.log(output)

Yields:

<table>
<thead>
<tr>
<th>a</th>
</tr>
</thead>
<tbody>
<tr>
<td>b</td>
</tr>
</tbody>
</table>



<table>
<thead>
<tr>
<th>a</th>
</tr>
</thead>
<tbody>
<tr>
<td>b</td>
</tr>
</tbody>
</table>

@wooorm wooorm closed this as completed May 10, 2023
@wooorm wooorm added the 💪 phase/solved Post is done label May 10, 2023
@github-actions github-actions bot removed the 👍 phase/yes Post is accepted and can be worked on label May 10, 2023
@wooorm
Copy link
Member

wooorm commented May 10, 2023

Released in 1.0.6!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 phase/solved Post is done
Development

No branches or pull requests

2 participants