Closed iljapanic closed 3 years ago
Syntax extensions and other things in remark happen through plugins from community members.
Here’s an example of a remark plugin that adds supported for a new syntax, in this case math: https://github.com/remarkjs/remark-math/blob/main/packages/remark-math/index.js.
It defers to two other things. A micromark extension, which handles the tokenizing, and an mdast utility, which handles tokens -> ast, and ast -> string. Most of the work for marks would be close to how strikethrough works: https://github.com/micromark/micromark-extension-gfm-strikethrough/blob/main/index.js.
Subject of the feature
Many popular markdown editors such as iA Writer, Typora, Obsidian use
==
to denote highlighted text and wrap the output in<mark>
tags.It now seems to have become a standard notation for highlighting. See discussion on CommonMark forum for more details. I.e. Remark supports the highlighting syntax.
Here are details on the
<mark>
HTML element:Full
<mark>
specExpected behavior
Markdown
HTML output
HTML default rendering