mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-02-17 02:00:54 +00:00
feat: configure linkify in markdownit with tlds
See https://markdown-it.github.io/markdown-it/ Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
0b06ce53e6
commit
50176170c3
1 changed files with 2 additions and 0 deletions
|
@ -7,12 +7,14 @@
|
|||
import { MarkdownExtension } from './markdown-extension'
|
||||
import linkify from 'markdown-it/lib/rules_core/linkify'
|
||||
import type MarkdownIt from 'markdown-it'
|
||||
import tlds from 'tlds'
|
||||
|
||||
/**
|
||||
* A markdown extension that detects plain text URLs and converts them into links.
|
||||
*/
|
||||
export class LinkifyFixMarkdownExtension extends MarkdownExtension {
|
||||
public configureMarkdownItPost(markdownIt: MarkdownIt): void {
|
||||
markdownIt.linkify.tlds(tlds)
|
||||
markdownIt.core.ruler.push('linkify', (state) => {
|
||||
try {
|
||||
state.md.options.linkify = true
|
||||
|
|
Loading…
Reference in a new issue