Beyond Markdown In developing Commonmark, we have tried, as far as possible, to remain faithful to John Gruber’s original Markdown syntax description. We have diverged from it only occasionally, in the interest of removing ambiguity and increasing uniformity, and with the addition of a few syntax elements that are now virtuously ubiquitous (like fenced code blocks and shortcut reference links). There are very good reasons for being conservative in this way. But this respect for the past has...| CommonMark Discussion
Hi everyone, I’ve been working on a lightweight internal documentation tool for my team, and I’m using CommonMark as the base for rendering Markdown. So far, the consistency and predictability of the spec have been a huge help — especially when dealing with nested elements and complex formatting. However, I’ve now reached a point where I need to slightly extend the syntax to support some custom elements specific to our workflow, such as @[note], @[warning], etc., which should render a...| CommonMark Discussion
@Andre601 The handling of this is not going to change, as it’s according to the spec, see e.g. the commonmark.js dingus example. I would recommend formatting your list differently. E.g. you could put a space before the : - [#hidePlayersEnabled()] : `NullBool.NOT_SET` - [#hidePlayersEnabled()] : this line is visible Another option would be to escape the :: - [#hidePlayersEnabled()]\: `NullBool.NOT_SET` - [#hidePlayersEnabled()]\: this line is visible| CommonMark Discussion - Latest posts
Hello I am working on a web application that allows users to submit content in Markdown using the CommonMark spec. One concern I have run into is handling raw HTML that users include in their submissions. 😇 While some users embed safe elements like or , others try injecting full HTML blocks, which poses security risks. 😇 I would like to allow Markdown input only; without allowing raw HTML to be rendered in the output. I am using the official CommonMark parser in Ja...| CommonMark Discussion
With the syntax for images supporting titles in http://jgm.github.io/stmd/spec.html#images it would be great if the image tag would expand to a figure with caption like:  My caption This is a departure from what is currently out there but an often requested feature that should find its way into the spec somehow (even with an alternative syntax).| CommonMark Discussion
Hi everyone, I’ve been exploring CommonMark for a while now and really appreciate its clean, unambiguous spec and the way it strives for consistent Markdown parsing across implementations. I’m currently working on a project where I need to extend CommonMark with some custom syntax features tailored to specific domain needs (for example, custom containers, enhanced tables, or specialized inline annotations). Before diving too deep, I wanted to ask the community about best practices or expe...| CommonMark Discussion
--- Title : Proposal for Markdown ruby tag syntax Author : Charles Jie (tw) Email : chjie7@gmail.com Tags : [markdown ruby syntax] Revision : 0.2 - formalized by DeepSeek, then refined Created : 2025-05-09 --- Proposal for Markdown ruby tag syntax requirements Easy to type – ASCII-only (avoid full-width ()【】). Easy to read – Base text remains clean (no quoting); ruby text should be subtle and ignorable. Minimal syntax – Prefer one symbol (e.g., ^) over pairs like [] or {}. Langu...| CommonMark Discussion - Latest posts
I would like to use this library, and convert Markdown to HTML. Unfortunately, I couldn’t find documentation with easy examples. There was some “Make_manpages.py” thing I didn’t understand. I couldn’t use python to make the manpage. And there are a lot of source files, I don’t know which to include and where to put them. I also wanted to ask if I could load the markdown file (it’s a folder of blog entries) into a 2D array and get the markdown into the function from there directl...| CommonMark Discussion - Latest posts
Hello everyone! We at the Diplodoc platform team have read this proposal and found it suitable for our purposes. And now we are actively implementing it into our documentation platform. For this, we created @diplodoc/directive package (it is available in npm). It is based on markdown-it-directive plugin from @lookas (many thanks to him), and allows us to quickly implement new blocks using directive syntax. We find this syntax convenient and are completely satisfied with our choice. Thank you ...| CommonMark Discussion - Latest posts
Using Commonmark java how to render html to markdown? I tried this example, but it is not rendering. @Slf4j class MarkdownTest { @Test void markdownTest() { String markdown = toMarkdown("<b> Hello World!</b>"); log.info("markdown ==> {}", markdown); } String toMarkdown(String html) { Node htmlDocument = Parser.builder().build().parse(html); return MarkdownRenderer.builder().build().render(htmlDocument); } } Output: markdown ==> <b> Hello World!</b>| CommonMark Discussion - Latest posts
I’ve already posted this issue in the GitHub repository but I’ve not get a response yet. It seems there is an issue with cmark_render_commonmark function. When it gets as an input a document that has a text node with a whitespace in the beginning, it does not return a correct Markdown string. For example, the following document: Document node → Paragraph node → Text node with text literal is rendered as text\n, which is a code block. From looking at some other library that deal with M...| CommonMark Discussion - Latest posts
I have a few things to talk about here. This is a bit long so I will provide some sections, treat this as a blog post if you want. markdown-it-math: My thoughts 10 years ago I wrote the markdown-it-math plugin 10 years ago as well as an AsciiMath dialog called mathup (then called Ascii2MathML) with the main purpose of being a good fit for markdown documents. I kept the markdown-it plugin as abandoned over the last 7 years but just returned to it earlier this month. Here are a few things I hav...| CommonMark Discussion - Latest posts
I couldn’t agree more, *Italic* and **Bold** should never have been used in the quick reference and tutorial when these words are not part of the spec. I opened a Github issue about this in October 2023. At the very least, I would change the help page and tutorial to use “emphasis” and “strong emphasis” to match the current spec ASAP. But I would also consider updating the both the spec and website to use the modern terminology “stress emphasis” and “strong importance”. Trea...| CommonMark Discussion - Latest posts
Please don’t pile “i agree” or “no!” comments onto the GitHub issue unless you have a new argument for or against, or some other useful additional info. JGM doesn’t need the noise. Use the emoticon reactions to register simple votes.| CommonMark Discussion - Latest posts
Click to view the poll. Context I’ve used Markdown dialects for a few years across Discourse, GitHub, GitLab, Plume, WriteFreely, and Bugzilla, et cetera. However, solely as a markup language designed to be rendered. Although I’ve never heard of its syntax being a problem in Discourse wikis, where the generally non-technical appear to be able to participate (and, consequently, read) without problem, I was recently told that some BRs that I considered to be very readable in plain-text form...| CommonMark Discussion - Latest posts
What do y’all use more often? Please, explain why in a comment below. If y’all use a mix of both, comment below what do you use each method for? Click to view the poll.| CommonMark Discussion - Latest posts
Hello. I’ve encountered that it can be very useful to enable simultaneous syntax highlighting for some exceptional cases. However, we are not talking about complex scenarios like nested language constructs, but about showing diff and patch changes alongside with the default language. This is a fairly universal highlight that colors the entire background of some lines. Is it possible to allow the combination of languages in code blocks when this mode comes first? I.e. I suggest to allo...| CommonMark Discussion - Latest posts
At the start of this standardization project, several people were involved and contributed enthusiastically. As the specification matured, @jgm became essentially the only contributor to advance it further, except for some volunteers who cared deeply about a certain issue or another. New releases have become less and less frequent in the last couple of years after just a handful of remaining issue needing to be solved before the first major release had been identified. Let’s assume these ac...| CommonMark Discussion - Latest posts
I propose we publish a mathemetical proof that 0.31.2 = 1.0| CommonMark Discussion - Latest posts
UAX #11 East Asian Width-based approach is simpler, I think. It is used by Firefox to check the character is Chinese/Japanese or not. (c.f. 1940947 - Treat half-width Korean won currency sign (U+20A9 ₩) as Korean, not Chinese or Japanese) I released plugins for remark / markdown-it, which is based on this idea: GitHub - tats-u/markdown-cjk-friendly: Make CommonMark more friendly for Japanese/Chinese/Korean (CommonMark next specification draft)—plugins & patched packages Specifications dra...| CommonMark Discussion - Latest posts
If you use the remark/micromark or markdown-it ecosystem, you have a good news: I released plugins for remark / markdown-it: GitHub - tats-u/markdown-cjk-friendly: Make CommonMark more friendly for Japanese/Chinese/Korean (CommonMark next specification draft)—plugins & patched packages Specifications draft is: markdown-cjk-friendly/specification.md at main · tats-u/markdown-cjk-friendly · GitHub If you bump into any issues, could you post one to here, the issue of that repository, or Comm...| CommonMark Discussion - Latest posts
Here: Allowing whitespaces in link URLs - #4 by ClikCode in 2018 @jgm wrote: I’ve already made the change allowing whitespace inside <...> links. But if I open commonmark.js demo and try <http://hyper.link/with spaces> there, it is rendered as is, that is, as <http://hyper.link/with spaces>. That is, as plain text, not as a hyperlink. Why is that?| CommonMark Discussion - Latest posts
I released plugins for remark / markdown-it: GitHub - tats-u/markdown-cjk-friendly: Make CommonMark more friendly for Japanese/Chinese/Korean (CommonMark next specification draft)—plugins & patched packages Specifications draft is: markdown-cjk-friendly/specification.md at main · tats-u/markdown-cjk-friendly · GitHub GitHub issue (feedbacks can be also here): Emphasis with CJK punctuation · Issue #650 · commonmark/commonmark-spec · GitHub Your feedback is very welcome.| CommonMark Discussion - Latest posts
<div id="input"> **bold** and <em>italic</em> - <https://example.com> - <https://example.net> </div> <script src="https://unpkg.com/commonmark@0.29.3/dist/commonmark.js"></script> <script> window.onload = function() { var markdown = document.querySelector('#input').innerHTML; var reader = new commonmark.Parser(); var writer = new commonmark.HtmlRenderer(); var parsed = reader.parse(markdown); var result = writer.render(parsed); document.querySelector('body').innerHTML = result; } </script> Ou...| CommonMark Discussion - Latest posts