-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Using micromark-extension-definition-list
does not work if micromark-extension-gfm-table
is used
#8
Comments
What does this have to do with this extension? |
Press the “Update all to latest” (refresh wheel) above the dependencies. |
When not using this extension it works as expected, after quite a bit of debugging none other changes than disabling this plugin worked. Thus the three examples in the stackblitz. |
Updated dependencies |
OK I found your request rather confusing, but you’re right that there is a problem. Here’s a reduced case: import { micromark } from "micromark";
import { gfmTable, gfmTableHtml } from "micromark-extension-gfm-table";
import { defList, defListHtml } from "micromark-extension-definition-list";
const markdown = `a
: b
| c |
| - |
`;
const output = micromark(markdown, {
extensions: [defList, gfmTable],
htmlExtensions: [defListHtml, gfmTableHtml],
});
console.log(output); Passing Have you though about treating this issue the other way around: what if this is something in |
definition-list
syntax somewheremicromark-extension-definition-list
does not work if micromark-extension-gfm-table
is used
First wanted to open it in Yes - there maybe something missing in See the "expected behaviour", GitHub is handling table-detection (or parsing or whatever) otherwise than the plugin - (or may have something completely else for that). Thus I'm assuming, when making this gfm-table plugin to behave like GitHub tables, it would fix it also, when this doesn't fix it of course than the other extension need to be adjusted as well.
|
Didn't found anything in GFM spec related to " Thus my current guess is that when the If there isn't something like "forcing nodes" at all available/implemented, I'll of course move this issue to the |
GFM does not support definition lists
This extension does not “force” paragraphs.
This extension behaves like GitHub. If not, that’s a bug. Can you prove a case, without definition lists, where that isn’t the case? |
Friendly ping! :) |
After further debugging I've found that the issue seems to be with some reformatting of blanks, when the When using For example pandoc/markdown extra php requires three spaces after the colon and before the content. The I don't know if the But even when using ExampleI've created a stackblitz demo shows all variants. Initial Spaces:
|
I think you’re observing something, but your conclusion is incorrect.
But see my reproduction above: #8 (comment). This isn’t about reformatting. It’s about parsing correctly or not. GFM + deflist doesn’t work. In HTML that means that no Reiterating my earlier question:
Have you tried asking there? |
@elbakerino Does it work using |
Yes the upgrade fixed it and defLists are now working together with gfm! |
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
withremark-gfm
andremark-definition-list
, compiling withrehype
.It does not matter what is
use
d first:remarkGfm
orremarkDefinitionList
.The output of
remark
looks correct, but not the HTML when usingunified
.The example contains one
gfm
withgfm-table
plugin (1:1 copy from repo) and one without it, whengfm-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: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:
Actual behavior
When using
micromark-extension-gfm-table
it forces, without that plugin it defaults to be compiled to HTML:Whereas GitHub creates:
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)
The text was updated successfully, but these errors were encountered: