diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-21 16:44:18 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-21 16:44:43 +0100 |
commit | e8cb44090e654fda339506dccfcec7fea8722723 (patch) | |
tree | 2a36d264cf44cededff0e272919316a3feabcbc1 /client/src/app/videos/shared | |
parent | 276d03ed1a469fd4e3579f92392b6f9a1567d1ca (diff) | |
download | PeerTube-e8cb44090e654fda339506dccfcec7fea8722723.tar.gz PeerTube-e8cb44090e654fda339506dccfcec7fea8722723.tar.zst PeerTube-e8cb44090e654fda339506dccfcec7fea8722723.zip |
Add links to comment mentions
Diffstat (limited to 'client/src/app/videos/shared')
-rw-r--r-- | client/src/app/videos/shared/markdown.service.ts | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/client/src/app/videos/shared/markdown.service.ts b/client/src/app/videos/shared/markdown.service.ts index bd100f092..fdd0ec8d2 100644 --- a/client/src/app/videos/shared/markdown.service.ts +++ b/client/src/app/videos/shared/markdown.service.ts | |||
@@ -5,7 +5,6 @@ import * as MarkdownIt from 'markdown-it' | |||
5 | @Injectable() | 5 | @Injectable() |
6 | export class MarkdownService { | 6 | export class MarkdownService { |
7 | private textMarkdownIt: MarkdownIt.MarkdownIt | 7 | private textMarkdownIt: MarkdownIt.MarkdownIt |
8 | private linkifier: MarkdownIt.MarkdownIt | ||
9 | private enhancedMarkdownIt: MarkdownIt.MarkdownIt | 8 | private enhancedMarkdownIt: MarkdownIt.MarkdownIt |
10 | 9 | ||
11 | constructor () { | 10 | constructor () { |
@@ -27,10 +26,6 @@ export class MarkdownService { | |||
27 | .enable('list') | 26 | .enable('list') |
28 | .enable('image') | 27 | .enable('image') |
29 | this.setTargetToLinks(this.enhancedMarkdownIt) | 28 | this.setTargetToLinks(this.enhancedMarkdownIt) |
30 | |||
31 | this.linkifier = new MarkdownIt('zero', { linkify: true }) | ||
32 | .enable('linkify') | ||
33 | this.setTargetToLinks(this.linkifier) | ||
34 | } | 29 | } |
35 | 30 | ||
36 | textMarkdownToHTML (markdown: string) { | 31 | textMarkdownToHTML (markdown: string) { |
@@ -45,12 +40,6 @@ export class MarkdownService { | |||
45 | return this.avoidTruncatedLinks(html) | 40 | return this.avoidTruncatedLinks(html) |
46 | } | 41 | } |
47 | 42 | ||
48 | linkify (text: string) { | ||
49 | const html = this.linkifier.render(text) | ||
50 | |||
51 | return this.avoidTruncatedLinks(html) | ||
52 | } | ||
53 | |||
54 | private setTargetToLinks (markdownIt: MarkdownIt.MarkdownIt) { | 43 | private setTargetToLinks (markdownIt: MarkdownIt.MarkdownIt) { |
55 | // Snippet from markdown-it documentation: https://github.com/markdown-it/markdown-it/blob/master/docs/architecture.md#renderer | 44 | // Snippet from markdown-it documentation: https://github.com/markdown-it/markdown-it/blob/master/docs/architecture.md#renderer |
56 | const defaultRender = markdownIt.renderer.rules.link_open || function (tokens, idx, options, env, self) { | 45 | const defaultRender = markdownIt.renderer.rules.link_open || function (tokens, idx, options, env, self) { |