Open hariria opened 1 month ago
Can you give a complete list of characters that are not liked? I'm used to using <
and >
but needing to escape {
and }
is new. What else?
i.e., what did you mean by "Same with other characters."? Which characters?
@brmataptos chatgpt ftw
In MDX, there are several characters that can cause issues when not properly escaped. Here are the key characters to watch out for and their HTML entity equivalents:
{}
{
becomes {
}
becomes }
<>
<
becomes <
>
becomes >
&
&
becomes &
"
and '
(less common issue in code snippets but still good to know)"
becomes "
'
becomes '
`
For backticks used in code blocks, you generally do not need to escape them within MDX. However, if backticks appear outside code blocks, you might need to ensure they are properly handled, often by enclosing them in backticks within the markdown itself.
#
becomes #
*
becomes *
+
becomes +
-
becomes -
=
becomes =
|
becomes |
~
becomes ~
This issue is stale because it has been open 45 days with no activity. Remove the stale
label or comment - otherwise this will be closed in 15 days.
Aptos Documentation Issue (Internal)
Unfortunately, it seems as though Move doc-gen does not compile MDX compatible markdown documents, which makes it challenging to create a Move Reference page.
Repro
Example: https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/move-stdlib/doc/acl.md
If you copy, paste into the playground below, you will receive an error
102:41: Could not parse expression with acorn
Test here: https://mdxjs.com/playground/
Root Cause
It seems as though mdx is unable to compile the code snippets within the markdown. It's trying to process
{
braces as inline code / JSX components I believe.Desired Solution
Ideally, the generated docs could use
HTML Entities
, which will properly render the curly braces{
and}
with}
and}
instead and<
,>
with<
and>
. Same with other characters.Example
Before HTML Entities
After HTML Entities
Requirements for MDX Doc-Gen