-
The README at https://github.com/micromark/micromark-extension-gfm-autolink-literal explains that GH has two algorithms for autolinking, and to get both parts, I would need to additionally use I'm struggling to understand what I gain or lose by using only one half of the algorithm. In a quick test, using import {useMemo} from 'react'
import micromark from 'micromark'
import gfmAutolinkLiteralSyntax from 'micromark-extension-gfm-autolink-literal'
import gfmAutolinkLiteralHtml from 'micromark-extension-gfm-autolink-literal/html'
export const useMarkdown = source =>
useMemo(
() =>
micromark(source, {
extensions: [gfmAutolinkLiteralSyntax],
htmlExtensions: [gfmAutolinkLiteralHtml],
}),
[source],
) Could someone shed some light on what I'm missing by leaving out |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Some more info is here: micromark/micromark-extension-gfm-autolink-literal#6. |
Beta Was this translation helpful? Give feedback.
Some more info is here: micromark/micromark-extension-gfm-autolink-literal#6.
I only recently realised that GH employs two widely differing algorithms, which they don’t document. That thread above shows how I figured it out. The main thing is that the “parsing” works if there are no “open” brackets. The “AST” one works if there is an open
[
.