question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFC: MDX comment syntax

See original GitHub issue

As part of #1039 comment syntax currently only supports JS comment expressions:

# Hello, world!

{/* I am a comment */}

This syntax is nice because it feels more JSX-y than HTML comments. However, it comes at a cost of interoperability with Markdown (which uses HTML comments).

I’m inclined to think ensuring that we also support HTML comments (despite it being a bit precarious to have multiple syntaxes) is worth it so that your average Markdown/README file works with MDX out of the box.

# Hello, world!

{/* I'm a comment */}
<!-- I'm a comment, too! -->

Anyone have any thoughts or opinions here?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:17
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
ChristopherBiscardicommented, Apr 30, 2020

I agree

2reactions
leebyroncommented, Jan 10, 2022

I was also surprised by this and it posed a real barrier to adopting MDX for me (I have many existing markdown files with comments that I wanted to migrate to MDX and could not). So I wrote a plugin:

https://github.com/leebyron/remark-comment

I think I have an acceptable navigation of the whole “JSX is not HTML” issue:

  • HTML comments cannot be included in JSX. Preserves the idea that JSX is just JSX.
  • HTML comments are not emitted to the rendered output. This was always something I wanted my markdown renderer to do anyway, so I saw this as a side benefit. However this also side-steps the problem of trying to decide how to emit an HTML comment as a JSX node. It just does not.

I’d love to see this behavior built into MDX proper, but for now am working well, albeit with a more complex config, with this plugin.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Comments (MDX Syntax) - SQL Server - Microsoft Learn
Comments are non-executing text strings in program code. (Comments are also known as remarks). You can use comments to document code, or ...
Read more >
Comments (MDX) | InterSystems IRIS Data Platform 2022.2
Comments - This section discusses comments in InterSystems MDX queries and in stand-alone MDX expressions used within model definitions.
Read more >
MDX Parser doesn't work - RFC check of MDX - SAP Community
I am getting this error after the New NetWeaver Installation and Try to perform RFC test of MDX rfc under TCP connections. Add...
Read more >
MDX Comments - Oracle Help Center
MDX supports inline comments beginning with two hyphens. Beginning with two hyphens, the rest of the line is ignored by the MDX parser....
Read more >
MicroStrategy MDX Cube Reporting Guide
and properties data. For more information on MDX syntax, visit ... and server components of the SAP system that use the SAP protocols...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found