File tree 3 files changed +24
-3
lines changed
3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 148
148
"nanoid" : " ^3.1.20" ,
149
149
"react" : " ^17.0.0" ,
150
150
"react-dom" : " ^17.0.0" ,
151
- "styled-components" : " ^5.2.1"
151
+ "styled-components" : " ^5.2.1" ,
152
+ "turndown" : " ^7.0.0"
152
153
},
153
154
"devDependencies" : {
154
155
"@svgr/webpack" : " ^5.5.0" ,
155
156
"@types/react" : " ^16.9.53" ,
156
157
"@types/react-dom" : " ^16.9.8" ,
158
+ "@types/turndown" : " ^5.0.0" ,
157
159
"@typescript-eslint/eslint-plugin" : " ^3.0.2" ,
158
160
"@typescript-eslint/parser" : " ^3.0.2" ,
159
161
"babel-plugin-styled-components" : " ^1.12.0" ,
Original file line number Diff line number Diff line change 1
1
import 'module-alias/register' ;
2
2
import * as vscode from 'vscode' ;
3
+ import * as TurndownService from 'turndown' ;
3
4
4
5
import { uriHandler , CodingServer } from 'src/codingServer' ;
5
6
import { Panel } from 'src/panel' ;
@@ -45,6 +46,7 @@ export async function activate(context: vscode.ExtensionContext) {
45
46
showCollapseAll : true ,
46
47
} ) ;
47
48
49
+ const tdService = new TurndownService ( ) ;
48
50
const commentController = vscode . comments . createCommentController (
49
51
'mr-comment' ,
50
52
'Merge request diff comments' ,
@@ -236,11 +238,11 @@ export async function activate(context: vscode.ExtensionContext) {
236
238
const lineNum = isLeft ? rootLine . leftNo : rootLine . rightNo ;
237
239
const range = new vscode . Range ( lineNum , 0 , lineNum , 0 ) ;
238
240
const commentList : vscode . Comment [ ] = i . map ( ( c ) => {
239
- const body = new vscode . MarkdownString ( ` ${ c . content } ` ) ;
241
+ const body = new vscode . MarkdownString ( tdService . turndown ( c . content ) ) ;
240
242
body . isTrusted = true ;
241
243
const comment : vscode . Comment = {
242
244
mode : vscode . CommentMode . Preview ,
243
- body : c . content ,
245
+ body,
244
246
author : {
245
247
name : `${ c . author . name } (${ c . author . global_key } )` ,
246
248
iconPath : vscode . Uri . parse ( c . author . avatar , false ) ,
Original file line number Diff line number Diff line change 1445
1445
dependencies :
1446
1446
" @types/node" " *"
1447
1447
1448
+ " @types/turndown@^5.0.0 " :
1449
+ version "5.0.0"
1450
+ resolved "https://registry.yarnpkg.com/@types/turndown/-/turndown-5.0.0.tgz#2b763b36f783e4e237cea62cdc8f8592b72b9285"
1451
+ integrity sha512-Y7KZn6SfSv1vzjByJGijrM9w99HoUbLiAgYwe+sGH6RYi5diIGLYOcr4Z1YqR2biFs9K5PnxKv/Fbkmh57pvzg==
1452
+
1448
1453
" @typescript-eslint/eslint-plugin@^3.0.2 " :
1449
1454
version "3.10.1"
1450
1455
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.10.1.tgz#7e061338a1383f59edc204c605899f93dc2e2c8f"
@@ -3138,6 +3143,11 @@ domelementtype@^2.0.1:
3138
3143
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.1.0.tgz#a851c080a6d1c3d94344aed151d99f669edf585e"
3139
3144
integrity sha512-LsTgx/L5VpD+Q8lmsXSHW2WpA+eBlZ9HPf3erD1IoPF00/3JKHZ3BknUVA2QGDNu69ZNmyFmCWBSO45XjYKC5w==
3140
3145
3146
+ domino@^2.1.6 :
3147
+ version "2.1.6"
3148
+ resolved "https://registry.yarnpkg.com/domino/-/domino-2.1.6.tgz#fe4ace4310526e5e7b9d12c7de01b7f485a57ffe"
3149
+ integrity sha512-3VdM/SXBZX2omc9JF9nOPCtDaYQ67BGp5CoLpIQlO2KCAPETs8TcDHacF26jXadGbvUteZzRTeos2fhID5+ucQ==
3150
+
3141
3151
domutils@^1.7.0 :
3142
3152
version "1.7.0"
3143
3153
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a"
@@ -7295,6 +7305,13 @@ tunnel-agent@^0.6.0:
7295
7305
dependencies :
7296
7306
safe-buffer "^5.0.1"
7297
7307
7308
+ turndown@^7.0.0 :
7309
+ version "7.0.0"
7310
+ resolved "https://registry.yarnpkg.com/turndown/-/turndown-7.0.0.tgz#19b2a6a2d1d700387a1e07665414e4af4fec5225"
7311
+ integrity sha512-G1FfxfR0mUNMeGjszLYl3kxtopC4O9DRRiMlMDDVHvU1jaBkGFg4qxIyjIk2aiKLHyDyZvZyu4qBO2guuYBy3Q==
7312
+ dependencies :
7313
+ domino "^2.1.6"
7314
+
7298
7315
tweetnacl@^0.14.3, tweetnacl@~0.14.0 :
7299
7316
version "0.14.5"
7300
7317
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
You can’t perform that action at this time.
0 commit comments