Improve Markdown/CommonMark/Djot Syntax Support

Markdown

Markdown is a lightweight markup language for creating formatted text using a plain-text editor. John Gruber and Aaron Swartz created Markdown in 2004 as a markup language that is intended to be easy to read in its source code form. Markdown is widely used for blogging and instant messaging, and also used elsewhere in online forums, collaborative software, documentation pages, and readme files.

CommonMark (Popular)

The initial description of Markdown contained ambiguities and raised unanswered questions, causing implementations to both intentionally and accidentally diverge from the original version. This was addressed in 2014 when long-standing Markdown contributors released CommonMark, an unambiguous specification and test suite for Markdown.

Djot (New)

Djot is a light markup syntax. It derives most of its features from commonmark, but it fixes a few things that make commonmark’s syntax complex and difficult to parse efficiently. It is also much fuller-featured than commonmark, with support for definition lists, footnotes, tables, several new kinds of inline formatting (insert, delete, highlight, superscript, subscript), math, smart punctuation, attributes that can be applied to any element, and generic containers for block-level, inline-level, and raw content.

The project began as an attempt to implement some of the ideas I suggested in my essay Beyond Markdown. (See Rationale, below.)

Djot isn’t completely stable yet, minor future changes to the syntax are expected. The official JavaScript implementation is complete and ready for use.

Reasons/Proposal

OnlyOffice has “-” and “1.” that defines lists automatically, and ONLYOFFICE integrates Doc2md: convert documents to markdown, however, alternatives such as Google Docs and Notebooks apps (Joplin, Standard Notes, Obsidian…) tries to implement more markdown features to improve workflow, and it works wonders!

Would like to propose more Markdown snippets to automatically create Header, bold, italic… using Markdown-it since it is CommonMark compliant and is widely used across websites such as Discourse, GitHub, Reddit, Telegram…

Referencing the syntax of Markdown-it for reference, not all would be implemented, although the more the better

Demo

Option Syntax
Heading # Header1, ## Header2 ### Header3…
Typographic replacements See Demo
Bold **This is bold text** or __This is bold text__.
italic *This is italic text* or _This is italic text_
Strikethrough ~~Strikethrough~~
Blockquotes >, >>…
Lists Create a list by starting a line with +, -, *`, 1. (1. 2. or 1. 1.)
Code Inline code (`) and BlockCode (```)
Table See Demo
Horizontal Rules* See Demo (----)

Plugins (Demo)

Option Syntax
Emojies :+1: :+1: :-1::-1:
Subscript / Superscript 19^th^ / H~2~O
<ins> ++Inserted text++
<mark> ==Marked text==
Footnotes Footnote 1 link[^first].
Definition lists See Demo
Custom containers See Demo

Google Docs support:

  • Headers
  • Bold and italic
  • lists

Microsoft support:

None (Office online), but there is a third party extension — Writage

LibreOffice support:

Disabled by default (OpenOffice Enable guide, and bugzilla: tdf#133023)

Extra/Horizontal Rules*

OnlyOffice has -- → — which is an em-dash (consist of 3 ---, in Markdown)
Could it change to:

  • - → -
  • -- → – (an en-dash)
  • --- → — (an em-dash)
  • ---- → Horizontal rule (line below)

Hey @NamelessGO :wave:
Thank you for the detailed description of the proposal.
We will definitely review it and get back to you with a decision!

Hello, @NamelessGO

After discussing this with our team, we don’t have any immediate plans to create a full-fledged markdown editor. Please feel free to share your feedback. We will definitely review it and consider adding it to the proposal for all interested parties

1 Like

Could the Heading function (#) be implemented?

It should be the same logic as lists (-) and numbered list (1., 2.) and would fit nicely with OnlyOffice Topic of Contents Sidebar just like it is on GDocs

The Heading from OO was using the function Heading in topbar/toolbar
The Heading from GD was using # Heading, ## Heading 2…

This would help GD users migrate to OO


Hello @NamelessGO
If you don’t mind, I will step to this thread too.

As far as I understand, the Heading function (#) is a part of full-fledged markdown editor. As @Nikolas mentioned before, we don’t have strict plans for it at the moment, but we are open to discussions. From this point of view, there’s no reason for adding one of GD features without the others (full support) right now. However, we will get back to it later.
Sorry for the inconvenience.

1 Like