Skip to content

Instantly share code, notes, and snippets.

@andreajparker
Last active August 31, 2023 18:25
Show Gist options
  • Save andreajparker/cb9145375c2aa9ddf03d077f6211f4d9 to your computer and use it in GitHub Desktop.
Save andreajparker/cb9145375c2aa9ddf03d077f6211f4d9 to your computer and use it in GitHub Desktop.
2023-08-Markdown_variants

Intro

"Reddit's Markdown" is a bit borked: it doesn't seem to support linebreaks in Markdown tables. Below we outline the main 'variants' of Markdown, including what they were (originally) developed for, and then attempt to determine if we can somehow induce linebreaks into a 'Reddit Markdown' table.

(a) Main Markdown Variants

Markdown has evolved into several variants since its inception by John Gruber in 2004. Below is a table summarizing some of the main Markdown variants, their brief history, why they were developed, and their divergent features:

Variant Brief History Why Developed Divergent Features
CommonMark Developed in 2014 by John MacFarlane and others. To standardize Markdown and make it unambiguous. Stricter syntax rules, standardized, well-defined spec.
GitHub-Flavored Markdown (GFM) Developed by GitHub for use in its platform. To add features useful for code documentation and collaboration. Task lists, tables, fenced code blocks with syntax highlighting.
MultiMarkdown Created by Fletcher T. Penney in 2005. To extend the original Markdown with features for academic writing. Footnotes, citations, tables, definition lists.
Markdown Extra Created by Michel Fortin in 2005. To add additional features to the original Markdown. Tables, fenced code blocks, footnotes, abbreviations.
RMarkdown Developed for the R language. To integrate Markdown with R code for dynamic documents. Code chunks, inline code evaluation, export to multiple formats.
Pandoc Markdown Developed as part of the Pandoc document converter. To be a more flexible and powerful Markdown variant. Citations, footnotes, tables, math, multiple output formats.
Reddit Markdown Used on Reddit's platform. To allow basic text formatting in Reddit comments and posts. Limited subset, no tables, limited HTML support.

(b) Reddit's Markdown

Reddit uses a custom Markdown variant that is more limited compared to other Markdown variants. Specifically, Reddit's Markdown doesn't support tables, and its support for HTML tags like <br> is also limited. This is likely for security reasons and to maintain a consistent user experience across the platform.

What ChatGPT says: Line Breaks in Reddit Markdown Tables

Reddit's Markdown doesn't natively support tables or HTML line breaks within tables. However, you can use some workarounds to achieve a similar effect:

  1. Separate Lines: Instead of using a table, you can list the ingredients, steps, and tips/tricks as separate lines with bullet points.
  2. Multiple Comments: You can break your table into multiple comments, each containing a portion of the table.
  3. External Tools: Use an external tool to generate a screenshot of your table and then link to the image in your Reddit comment.

Unfortunately, Reddit's Markdown limitations mean you can't achieve exactly what you're looking for directly within a Reddit comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment