You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm a new (and happy!) mdx user, but I've ran into an issue. Perhaps I'm simply confused ! Here is the issue I ran into, please let me know if I am misunderstanding something about the legacy syntax error.
Issue
I'd like to use mdx to keep some code block in sync with files living in the tree, but when I try adding mdx labels on top of my code blocks, I get an error regarding mixing legacy and new syntax.
which I think comes from that mdx error, from lib/block.ml:
Error [ `Msg"cannot mix both block labels syntax" ]
I am guessing that you want to lead new users towards the new syntax, while preserving backward compatibility, so I think I understand the reason for this error in general. But I wonder if this is right to reject all code block properties, simply because some of them may be targeting other markdown tools. I don't expect you'd want mdx to handle all markdown properties out there. So if I'm understanding things correctly, I would like to propose to relax the rejection rule:
Proposal
Current behavior
Complain about mixing syntax and reject md files that have code block properties if they have a <!-- $MDX --> leading header.
Desired behavior
Complain about mixing syntax for mdx specific properties. Keep the code block properties mdx doesn't know about untouched, on the assumption that they might be targeting other tools.
Detailing my understanding of both syntaxes
Legacy vs New syntax
Legacy syntax
```ocaml prop=value
```
New syntax
<!-- $MDX prop=value -->
```ocaml
```
The text was updated successfully, but these errors were encountered:
Hi!
I'm a new (and happy!) mdx user, but I've ran into an issue. Perhaps I'm simply confused ! Here is the issue I ran into, please let me know if I am misunderstanding something about the legacy syntax error.
Issue
I'd like to use mdx to keep some code block in sync with files living in the tree, but when I try adding mdx labels on top of my code blocks, I get an error regarding mixing legacy and new syntax.
An example using
showLineNumbers
from https://docusaurus.io/docs/markdown-features/code-blocks#line-numberingThis renders fine in my doc, but this causes a mdx error when running
dune runtest
which I think comes from that mdx error, from
lib/block.ml
:I am guessing that you want to lead new users towards the new syntax, while preserving backward compatibility, so I think I understand the reason for this error in general. But I wonder if this is right to reject all code block properties, simply because some of them may be targeting other markdown tools. I don't expect you'd want mdx to handle all markdown properties out there. So if I'm understanding things correctly, I would like to propose to relax the rejection rule:
Proposal
Current behavior
Complain about mixing syntax and reject md files that have code block properties if they have a
<!-- $MDX -->
leading header.Desired behavior
Complain about mixing syntax for mdx specific properties. Keep the code block properties mdx doesn't know about untouched, on the assumption that they might be targeting other tools.
Detailing my understanding of both syntaxes
Legacy vs New syntax
Legacy syntax
New syntax
The text was updated successfully, but these errors were encountered: