Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
eabec006
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
eabec006
编写于
9月 17, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update to marked 0.5.0, #56749
上级
7fcd81cd
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
322 addition
and
186 deletion
+322
-186
src/vs/base/browser/htmlContentRenderer.ts
src/vs/base/browser/htmlContentRenderer.ts
+2
-2
src/vs/base/common/marked/OSSREADME.json
src/vs/base/common/marked/OSSREADME.json
+8
-7
src/vs/base/common/marked/marked.d.ts
src/vs/base/common/marked/marked.d.ts
+252
-117
src/vs/base/common/marked/marked.js
src/vs/base/common/marked/marked.js
+54
-54
src/vs/base/test/browser/htmlContent.test.ts
src/vs/base/test/browser/htmlContent.test.ts
+1
-1
src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts
...ench/parts/extensions/electron-browser/extensionEditor.ts
+1
-1
src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts
...bench/parts/update/electron-browser/releaseNotesEditor.ts
+1
-1
src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts
...s/welcome/walkThrough/electron-browser/walkThroughPart.ts
+1
-1
src/vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider.ts
...ts/welcome/walkThrough/node/walkThroughContentProvider.ts
+1
-1
src/vs/workbench/parts/welcome/walkThrough/node/walkThroughInput.ts
...kbench/parts/welcome/walkThrough/node/walkThroughInput.ts
+1
-1
未找到文件。
src/vs/base/browser/htmlContentRenderer.ts
浏览文件 @
eabec006
...
...
@@ -9,7 +9,7 @@ import * as DOM from 'vs/base/browser/dom';
import
{
defaultGenerator
}
from
'
vs/base/common/idGenerator
'
;
import
{
escape
}
from
'
vs/base/common/strings
'
;
import
{
removeMarkdownEscapes
,
IMarkdownString
}
from
'
vs/base/common/htmlContent
'
;
import
{
marked
,
MarkedOptions
}
from
'
vs/base/common/marked/marked
'
;
import
*
as
marked
from
'
vs/base/common/marked/marked
'
;
import
{
IMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -159,7 +159,7 @@ export function renderMarkdown(markdown: IMarkdownString, options: RenderOptions
}));
}
const
markedOptions
:
MarkedOptions
=
{
const
markedOptions
:
marked
.
MarkedOptions
=
{
sanitize
:
true
,
renderer
};
...
...
src/vs/base/common/marked/OSSREADME.json
浏览文件 @
eabec006
//
ATTENTION
-
THIS
DIRECTORY
CONTAINS
THIRD
PARTY
OPEN
SOURCE
MATERIALS:
[{
"name"
:
"chjj-marked"
,
"repositoryURL"
:
"https://github.com/npmcomponent/chjj-marked"
,
"version"
:
"0.3.18"
,
"license"
:
"MIT"
}]
[
{
"name"
:
"marked"
,
"repositoryURL"
:
"https://github.com/markedjs/marked"
,
"version"
:
"0.5.0"
,
"license"
:
"MIT"
}
]
src/vs/base/common/marked/marked.d.ts
浏览文件 @
eabec006
...
...
@@ -3,36 +3,41 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Type definitions for Marked
// Project:https://github.com/chjj/marked
// Definitions by:William Orr <https://github.com/worr>
// Definitions:https://github.com/borisyankov/DefinitelyTyped
// Type definitions for Marked 0.4
// Project: https://github.com/markedjs/marked
// Definitions by: William Orr <https://github.com/worr>
// BendingBender <https://github.com/BendingBender>
// CrossR <https://github.com/CrossR>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export
interface
MarkedStatic
{
/**
* Compiles markdown to HTML.
*
* @param src String of markdown source to be compiled
* @param callback Function called when the markdownString has been fully parsed when using async highlighting
* @return String of compiled HTML
*/
(
src
:
string
,
callback
:
Function
):
string
;
export
as
namespace
marked
;
/**
* Compiles markdown to HTML.
*
* @param src String of markdown source to be compiled
* @param options Hash of options
* @param callback Function called when the markdownString has been fully parsed when using async highlighting
* @return String of compiled HTML
*/
(
src
:
string
,
options
?:
MarkedOptions
,
callback
?:
Function
):
string
;
export
=
marked
;
/**
* Compiles markdown to HTML.
*
* @param src String of markdown source to be compiled
* @param callback Function called when the markdownString has been fully parsed when using async highlighting
* @return String of compiled HTML
*/
declare
function
marked
(
src
:
string
,
callback
:
(
error
:
any
|
undefined
,
parseResult
:
string
)
=>
void
):
string
;
/**
* Compiles markdown to HTML.
*
* @param src String of markdown source to be compiled
* @param options Hash of options
* @param callback Function called when the markdownString has been fully parsed when using async highlighting
* @return String of compiled HTML
*/
declare
function
marked
(
src
:
string
,
options
?:
marked
.
MarkedOptions
,
callback
?:
(
error
:
any
|
undefined
,
parseResult
:
string
)
=>
void
):
string
;
declare
namespace
marked
{
/**
* @param src String of markdown source to be compiled
* @param options Hash of options
*/
lexer
(
src
:
string
,
options
?:
MarkedOptions
):
any
[]
;
function
lexer
(
src
:
string
,
options
?:
MarkedOptions
):
TokensList
;
/**
* Compiles markdown to HTML.
...
...
@@ -41,7 +46,7 @@ export interface MarkedStatic {
* @param callback Function called when the markdownString has been fully parsed when using async highlighting
* @return String of compiled HTML
*/
parse
(
src
:
string
,
callback
:
Function
):
string
;
function
parse
(
src
:
string
,
callback
:
(
error
:
any
|
undefined
,
parseResult
:
string
)
=>
void
):
string
;
/**
* Compiles markdown to HTML.
...
...
@@ -51,112 +56,242 @@ export interface MarkedStatic {
* @param callback Function called when the markdownString has been fully parsed when using async highlighting
* @return String of compiled HTML
*/
parse
(
src
:
string
,
options
?:
MarkedOptions
,
callback
?:
Function
):
string
;
function
parse
(
src
:
string
,
options
?:
MarkedOptions
,
callback
?:
(
error
:
any
|
undefined
,
parseResult
:
string
)
=>
void
):
string
;
/**
* @param src Tokenized source as array of tokens
* @param options Hash of options
*/
parser
(
src
:
any
[]
,
options
?:
MarkedOptions
):
string
;
function
parser
(
src
:
TokensList
,
options
?:
MarkedOptions
):
string
;
/**
* Sets the default options.
*
* @param options Hash of options
*/
setOptions
(
options
:
MarkedOptions
):
voi
d
;
function
setOptions
(
options
:
MarkedOptions
):
typeof
marke
d
;
/**
* Custom renderer for marked.
*/
Renderer
:
Renderer
;
}
class
Renderer
{
constructor
(
options
?:
MarkedOptions
);
code
(
code
:
string
,
language
:
string
,
isEscaped
:
boolean
):
string
;
blockquote
(
quote
:
string
):
string
;
html
(
html
:
string
):
string
;
heading
(
text
:
string
,
level
:
number
,
raw
:
string
):
string
;
hr
():
string
;
list
(
body
:
string
,
ordered
:
boolean
):
string
;
listitem
(
text
:
string
):
string
;
paragraph
(
text
:
string
):
string
;
table
(
header
:
string
,
body
:
string
):
string
;
tablerow
(
content
:
string
):
string
;
tablecell
(
content
:
string
,
flags
:
{
header
:
boolean
;
align
:
'
center
'
|
'
left
'
|
'
right
'
|
null
;
}):
string
;
strong
(
text
:
string
):
string
;
em
(
text
:
string
):
string
;
codespan
(
code
:
string
):
string
;
br
():
string
;
del
(
text
:
string
):
string
;
link
(
href
:
string
,
title
:
string
,
text
:
string
):
string
;
image
(
href
:
string
,
title
:
string
,
text
:
string
):
string
;
text
(
text
:
string
):
string
;
}
export
interface
Renderer
{
prototype
:
MarkedRenderer
;
new
():
MarkedRenderer
;
}
class
Lexer
{
rules
:
Rules
;
tokens
:
TokensList
;
constructor
(
options
?:
MarkedOptions
);
lex
(
src
:
string
):
TokensList
;
}
export
interface
MarkedRenderer
{
image
(
href
:
string
,
title
:
string
,
text
:
string
):
string
;
code
(
code
:
string
,
language
:
string
):
string
;
blockquote
(
quote
:
string
):
string
;
html
(
html
:
string
):
string
;
heading
(
text
:
string
,
level
:
number
):
string
;
hr
():
string
;
list
(
body
:
string
,
ordered
:
boolean
):
string
;
listitem
(
text
:
string
):
string
;
paragraph
(
text
:
string
):
string
;
table
(
header
:
string
,
body
:
string
):
string
;
tablerow
(
content
:
string
):
string
;
tablecell
(
content
:
string
,
flags
:
ITableFlags
):
string
;
strong
(
text
:
string
):
string
;
em
(
text
:
string
):
string
;
codespan
(
code
:
string
):
string
;
br
():
string
;
del
(
text
:
string
):
string
;
link
(
href
:
string
,
title
:
string
,
text
:
string
):
string
;
}
interface
Rules
{
[
ruleName
:
string
]:
RegExp
|
Rules
;
}
export
interface
ITableFlags
{
header
:
boolean
;
align
:
string
;
// 'center' || 'left' || 'right'
}
type
TokensList
=
Token
[]
&
{
links
:
{
[
key
:
string
]:
{
href
:
string
;
title
:
string
;
}
}
};
export
interface
MarkedOptions
{
/**
* Enable GitHub flavored markdown.
*/
gfm
?:
boolean
;
/**
* Enable GFM tables. This option requires the gfm option to be true.
*/
tables
?:
boolean
;
/**
* Enable GFM line breaks. This option requires the gfm option to be true.
*/
breaks
?:
boolean
;
/**
* Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior.
*/
pedantic
?:
boolean
;
/**
* Sanitize the output. Ignore any HTML that has been input.
*/
sanitize
?:
boolean
;
/**
* Use smarter list behavior than the original markdown. May eventually be default with the old behavior moved into pedantic.
*/
smartLists
?:
boolean
;
/**
* Shows an HTML error message when rendering fails.
*/
silent
?:
boolean
;
/**
* A function to highlight code blocks. The function takes three arguments:code, lang, and callback.
*/
highlight
?(
code
:
string
,
lang
:
string
,
callback
?:
Function
):
void
;
/**
* Set the prefix for code block classes.
*/
langPrefix
?:
string
;
/**
* Use "smart" typograhic punctuation for things like quotes and dashes.
*/
smartypants
?:
boolean
;
/**
* The renderer to use with marked rendering.
*/
renderer
?:
any
;
}
type
Token
=
Tokens
.
Space
|
Tokens
.
Code
|
Tokens
.
Heading
|
Tokens
.
Table
|
Tokens
.
Hr
|
Tokens
.
BlockquoteStart
|
Tokens
.
BlockquoteEnd
|
Tokens
.
ListStart
|
Tokens
.
LooseItemStart
|
Tokens
.
ListItemStart
|
Tokens
.
ListItemEnd
|
Tokens
.
ListEnd
|
Tokens
.
Paragraph
|
Tokens
.
HTML
|
Tokens
.
Text
;
namespace
Tokens
{
interface
Space
{
type
:
'
space
'
;
}
interface
Code
{
type
:
'
code
'
;
lang
?:
string
;
text
:
string
;
}
interface
Heading
{
type
:
'
heading
'
;
depth
:
number
;
text
:
string
;
}
interface
Table
{
type
:
'
table
'
;
header
:
string
[];
align
:
Array
<
'
center
'
|
'
left
'
|
'
right
'
|
null
>
;
cells
:
string
[][];
}
interface
Hr
{
type
:
'
hr
'
;
}
interface
BlockquoteStart
{
type
:
'
blockquote_start
'
;
}
export
declare
var
marked
:
MarkedStatic
;
\ No newline at end of file
interface
BlockquoteEnd
{
type
:
'
blockquote_end
'
;
}
interface
ListStart
{
type
:
'
list_start
'
;
ordered
:
boolean
;
}
interface
LooseItemStart
{
type
:
'
loose_item_start
'
;
}
interface
ListItemStart
{
type
:
'
list_item_start
'
;
}
interface
ListItemEnd
{
type
:
'
list_item_end
'
;
}
interface
ListEnd
{
type
:
'
list_end
'
;
}
interface
Paragraph
{
type
:
'
paragraph
'
;
pre
?:
boolean
;
text
:
string
;
}
interface
HTML
{
type
:
'
html
'
;
pre
:
boolean
;
text
:
string
;
}
interface
Text
{
type
:
'
text
'
;
text
:
string
;
}
}
interface
MarkedOptions
{
/**
* A prefix URL for any relative link.
*/
baseUrl
?:
string
;
/**
* Enable GFM line breaks. This option requires the gfm option to be true.
*/
breaks
?:
boolean
;
/**
* Enable GitHub flavored markdown.
*/
gfm
?:
boolean
;
/**
* Include an id attribute when emitting headings.
*/
headerIds
?:
boolean
;
/**
* Set the prefix for header tag ids.
*/
headerPrefix
?:
string
;
/**
* A function to highlight code blocks. The function takes three arguments: code, lang, and callback.
*/
highlight
?(
code
:
string
,
lang
:
string
,
callback
?:
(
error
:
any
|
undefined
,
code
:
string
)
=>
void
):
string
;
/**
* Set the prefix for code block classes.
*/
langPrefix
?:
string
;
/**
* Mangle autolinks (<email@domain.com>).
*/
mangle
?:
boolean
;
/**
* Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior.
*/
pedantic
?:
boolean
;
/**
* Type: object Default: new Renderer()
*
* An object containing functions to render tokens to HTML.
*/
renderer
?:
Renderer
;
/**
* Sanitize the output. Ignore any HTML that has been input.
*/
sanitize
?:
boolean
;
/**
* Optionally sanitize found HTML with a sanitizer function.
*/
sanitizer
?(
html
:
string
):
string
;
/**
* Shows an HTML error message when rendering fails.
*/
silent
?:
boolean
;
/**
* Use smarter list behavior than the original markdown. May eventually be default with the old behavior moved into pedantic.
*/
smartLists
?:
boolean
;
/**
* Use "smart" typograhic punctuation for things like quotes and dashes.
*/
smartypants
?:
boolean
;
/**
* Enable GFM tables. This option requires the gfm option to be true.
*/
tables
?:
boolean
;
/**
* Generate closing slash for self-closing tags (<br/> instead of <br>)
*/
xhtml
?:
boolean
;
}
}
src/vs/base/common/marked/marked.js
浏览文件 @
eabec006
...
...
@@ -4,9 +4,7 @@
* https://github.com/markedjs/marked
*/
var
__marked_exports
;
;
(
function
(
root
)
{
;(
function
(
root
)
{
'
use strict
'
;
/**
...
...
@@ -137,7 +135,7 @@ block.pedantic = merge({}, block.normal, {
function
Lexer
(
options
)
{
this
.
tokens
=
[];
this
.
tokens
.
links
=
{}
;
this
.
tokens
.
links
=
Object
.
create
(
null
)
;
this
.
options
=
options
||
marked
.
defaults
;
this
.
rules
=
block
.
normal
;
...
...
@@ -193,6 +191,9 @@ Lexer.prototype.token = function(src, top) {
bull
,
b
,
item
,
listStart
,
listItems
,
t
,
space
,
i
,
tag
,
...
...
@@ -318,15 +319,19 @@ Lexer.prototype.token = function(src, top) {
bull
=
cap
[
2
];
isordered
=
bull
.
length
>
1
;
this
.
tokens
.
push
(
{
listStart
=
{
type
:
'
list_start
'
,
ordered
:
isordered
,
start
:
isordered
?
+
bull
:
''
});
start
:
isordered
?
+
bull
:
''
,
loose
:
false
};
this
.
tokens
.
push
(
listStart
);
// Get each top-level item.
cap
=
cap
[
0
].
match
(
this
.
rules
.
item
);
listItems
=
[];
next
=
false
;
l
=
cap
.
length
;
i
=
0
;
...
...
@@ -367,6 +372,10 @@ Lexer.prototype.token = function(src, top) {
if
(
!
loose
)
loose
=
next
;
}
if
(
loose
)
{
listStart
.
loose
=
true
;
}
// Check for task list items
istask
=
/^
\[[
xX
]\]
/
.
test
(
item
);
ischecked
=
undefined
;
...
...
@@ -375,13 +384,15 @@ Lexer.prototype.token = function(src, top) {
item
=
item
.
replace
(
/^
\[[
xX
]\]
+/
,
''
);
}
this
.
tokens
.
push
({
type
:
loose
?
'
loose_item_start
'
:
'
list_item_start
'
,
t
=
{
type
:
'
list_item_start
'
,
task
:
istask
,
checked
:
ischecked
});
checked
:
ischecked
,
loose
:
loose
};
listItems
.
push
(
t
);
this
.
tokens
.
push
(
t
);
// Recurse.
this
.
token
(
item
,
false
);
...
...
@@ -391,6 +402,14 @@ Lexer.prototype.token = function(src, top) {
});
}
if
(
listStart
.
loose
)
{
l
=
listItems
.
length
;
i
=
0
;
for
(;
i
<
l
;
i
++
)
{
listItems
[
i
].
loose
=
true
;
}
}
this
.
tokens
.
push
({
type
:
'
list_end
'
});
...
...
@@ -521,10 +540,10 @@ var inline = {
link
:
/^!
?\[(
label
)\]\(
href
(?:\s
+
(
title
))?\s
*
\)
/
,
reflink
:
/^!
?\[(
label
)\]\[(?!\s
*
\])((?:\\[\[\]]?
|
[^\[\]\\])
+
)\]
/
,
nolink
:
/^!
?\[(?!\s
*
\])((?:\[[^\[\]]
*
\]
|
\\[\[\]]
|
[^\[\]])
*
)\](?:\[\])?
/
,
strong
:
/^__
([^\s]
[\s\S]
*
?[^\s])
__
(?!
_
)
|^
\*\*([^\s][\s\S]
*
?[^\s])\*\*(?!\*)
|^__
([^\s])
__
(?!
_
)
|^
\*\*(
[^\s])\*\*(?!\*)
/
,
em
:
/^_
([^\s
][\s\S]
*
?[^\s
_
])
_
(?!
_
)
|^_
([^\s
_
][\s\S]
*
?[^\s])
_
(?!
_
)
|^
\*([^\s][\s\S]
*
?[^\s
*
])\*(?!\*)
|^
\*([^\s
*
][\s\S]
*
?[^\s])\*(?!\*)
|^_
([^\s
_
])
_
(?!
_
)
|^
\*([^\s
*
])\*(?!\*)
/
,
strong
:
/^__
([^\s]
)
__
(?!
_
)
|^
\*\*([^\s])\*\*(?!\*)
|^__
([^\s][\s\S]
*
?[^\s])
__
(?!
_
)
|^
\*\*([^\s][\s\S]
*
?
[^\s])\*\*(?!\*)
/
,
em
:
/^_
([^\s
_
])
_
(?!
_
)
|^
\*([^\s
*"<
\[])\*(?!\*)
|^_
([^\s][\s\S]
*
?[^\s
_
])
_
(?!
_
)
|^_
([^\s
_
][\s\S]
*
?[^\s])
_
(?!
_
)
|^
\*([^\s
"<
\[][\s\S]
*
?[^\s
*
])\*(?!\*)
|^
\*([^\s
*"<
\[][\s\S]
*
?[^\s
])\*(?!\*)
/
,
code
:
/^
(
`+
)\s
*
([\s\S]
*
?[^
`
]?)\s
*
\1(?!
`
)
/
,
br
:
/^
{2,}
\n(?!\s
*$
)
/
,
br
:
/^
(
{2,}
|
\\)
\n(?!\s
*$
)
/
,
del
:
noop
,
text
:
/^
[\s\S]
+
?(?=[\\
<!
\[
`*
]
|
\b
_|
{2,}\n
|$
)
/
};
...
...
@@ -546,7 +565,7 @@ inline.tag = edit(inline.tag)
.
getRegex
();
inline
.
_label
=
/
(?:\[[^\[\]]
*
\]
|
\\[\[\]]?
|`
[^
`
]
*`|
[^\[\]\\])
*
?
/
;
inline
.
_href
=
/
\s
*
(
<
(?:\\[
<>
]?
|
[^\s
<>
\\])
*>|
(?:\\[
()
]?
|
\([^\s\x
00-
\x
1f
()
\\]
*
\)
|
[^\s\x
00-
\x
1f()
\\])
*
?)
/
;
inline
.
_href
=
/
\s
*
(
<
(?:\\[
<>
]?
|
[^\s
<>
\\])
*>|
(?:\\[
()
]?
|
\([^\s\x
00-
\x
1f
\\]
*
\)
|
[^\s\x
00-
\x
1f()
\\])
*
?)
/
;
inline
.
_title
=
/"
(?:\\
"
?
|
[^
"
\\])
*"|'
(?:\\
'
?
|
[^
'
\\])
*'|
\((?:\\\)?
|
[^
)
\\])
*
\)
/
;
inline
.
link
=
edit
(
inline
.
link
)
...
...
@@ -590,7 +609,7 @@ inline.gfm = merge({}, inline.normal, {
.
replace
(
'
email
'
,
inline
.
_email
)
.
getRegex
(),
_backpedal
:
/
(?:[^
?!.,:;*_~()&
]
+|
\([^
)
]
*
\)
|&
(?![
a-zA-Z0-9
]
+;$
)
|
[
?!.,:;*_~)
]
+
(?!
$
))
+/
,
del
:
/^~
~
(?=\S)([\s\S]
*
?\S)
~~
/
,
del
:
/^~
+
(?=\S)([\s\S]
*
?\S)
~+
/
,
text
:
edit
(
inline
.
text
)
.
replace
(
'
]|
'
,
'
~]|
'
)
.
replace
(
'
|
'
,
'
|https?://|ftp://|www
\\
.|[a-zA-Z0-9.!#$%&
\'
*+/=?^_`{
\\
|}~-]+@|
'
)
...
...
@@ -657,7 +676,8 @@ InlineLexer.prototype.output = function(src) {
text
,
href
,
title
,
cap
;
cap
,
prevCapZero
;
while
(
src
)
{
// escape
...
...
@@ -683,7 +703,10 @@ InlineLexer.prototype.output = function(src) {
// url (gfm)
if
(
!
this
.
inLink
&&
(
cap
=
this
.
rules
.
url
.
exec
(
src
)))
{
cap
[
0
]
=
this
.
rules
.
_backpedal
.
exec
(
cap
[
0
])[
0
];
do
{
prevCapZero
=
cap
[
0
];
cap
[
0
]
=
this
.
rules
.
_backpedal
.
exec
(
cap
[
0
])[
0
];
}
while
(
prevCapZero
!==
cap
[
0
]);
src
=
src
.
substring
(
cap
[
0
].
length
);
if
(
cap
[
2
]
===
'
@
'
)
{
text
=
escape
(
cap
[
0
]);
...
...
@@ -1219,30 +1242,22 @@ Parser.prototype.tok = function() {
}
case
'
list_item_start
'
:
{
body
=
''
;
var
loose
=
this
.
token
.
loose
;
if
(
this
.
token
.
task
)
{
body
+=
this
.
renderer
.
checkbox
(
this
.
token
.
checked
);
}
while
(
this
.
next
().
type
!==
'
list_item_end
'
)
{
body
+=
this
.
token
.
type
===
'
text
'
body
+=
!
loose
&&
this
.
token
.
type
===
'
text
'
?
this
.
parseText
()
:
this
.
tok
();
}
return
this
.
renderer
.
listitem
(
body
);
}
case
'
loose_item_start
'
:
{
body
=
''
;
while
(
this
.
next
().
type
!==
'
list_item_end
'
)
{
body
+=
this
.
tok
();
}
return
this
.
renderer
.
listitem
(
body
);
}
case
'
html
'
:
{
// TODO
@matt
parse inline content if parameter markdown=1
// TODO parse inline content if parameter markdown=1
return
this
.
renderer
.
html
(
this
.
token
.
text
);
}
case
'
paragraph
'
:
{
...
...
@@ -1547,27 +1562,12 @@ marked.InlineLexer = InlineLexer;
marked
.
inlineLexer
=
InlineLexer
.
output
;
marked
.
parse
=
marked
;
__marked_exports
=
marked
;
}).
call
(
this
);
// ESM-comment-begin
define
([],
function
()
{
return
{
marked
:
__marked_exports
};
});
// ESM-comment-end
// ESM-uncomment-begin
// export var marked = __marked_exports;
// export var Parser = __marked_exports.Parser;
// export var parser = __marked_exports.parser;
// export var Renderer = __marked_exports.Renderer;
// export var TextRenderer = __marked_exports.TextRenderer;
// export var Lexer = __marked_exports.Lexer;
// export var lexer = __marked_exports.lexer;
// export var InlineLexer = __marked_exports.InlineLexer;
// export var inlineLexer = __marked_exports.inlineLexer;
// export var parse = __marked_exports.parse;
// ESM-uncomment-end
if
(
typeof
module
!==
'
undefined
'
&&
typeof
exports
===
'
object
'
)
{
module
.
exports
=
marked
;
}
else
if
(
typeof
define
===
'
function
'
&&
define
.
amd
)
{
define
(
function
()
{
return
marked
;
});
}
else
{
root
.
marked
=
marked
;
}
})(
this
||
(
typeof
window
!==
'
undefined
'
?
window
:
global
));
\ No newline at end of file
src/vs/base/test/browser/htmlContent.test.ts
浏览文件 @
eabec006
...
...
@@ -5,7 +5,7 @@
'
use strict
'
;
import
*
as
assert
from
'
assert
'
;
import
{
marked
}
from
'
vs/base/common/marked/marked
'
;
import
*
as
marked
from
'
vs/base/common/marked/marked
'
;
import
{
renderMarkdown
,
renderText
,
renderFormattedText
}
from
'
vs/base/browser/htmlContentRenderer
'
;
suite
(
'
HtmlContent
'
,
()
=>
{
...
...
src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts
浏览文件 @
eabec006
...
...
@@ -8,7 +8,7 @@
import
'
vs/css!./media/extensionEditor
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
TPromise
,
Promise
}
from
'
vs/base/common/winjs.base
'
;
import
{
marked
}
from
'
vs/base/common/marked/marked
'
;
import
*
as
marked
from
'
vs/base/common/marked/marked
'
;
import
{
createCancelablePromise
}
from
'
vs/base/common/async
'
;
import
*
as
arrays
from
'
vs/base/common/arrays
'
;
import
{
OS
}
from
'
vs/base/common/platform
'
;
...
...
src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts
浏览文件 @
eabec006
...
...
@@ -6,7 +6,7 @@
'
use strict
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
marked
}
from
'
vs/base/common/marked/marked
'
;
import
*
as
marked
from
'
vs/base/common/marked/marked
'
;
import
{
OS
}
from
'
vs/base/common/platform
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
...
...
src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts
浏览文件 @
eabec006
...
...
@@ -16,7 +16,7 @@ import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
WalkThroughInput
}
from
'
vs/workbench/parts/welcome/walkThrough/node/walkThroughInput
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
marked
}
from
'
vs/base/common/marked/marked
'
;
import
*
as
marked
from
'
vs/base/common/marked/marked
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
CodeEditorWidget
}
from
'
vs/editor/browser/widget/codeEditorWidget
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
src/vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider.ts
浏览文件 @
eabec006
...
...
@@ -13,7 +13,7 @@ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfile
import
{
ITextModel
,
DefaultEndOfLine
,
EndOfLinePreference
,
ITextBufferFactory
}
from
'
vs/editor/common/model
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IWorkbenchContribution
}
from
'
vs/workbench/common/contributions
'
;
import
{
marked
}
from
'
vs/base/common/marked/marked
'
;
import
*
as
marked
from
'
vs/base/common/marked/marked
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
...
...
src/vs/workbench/parts/welcome/walkThrough/node/walkThroughInput.ts
浏览文件 @
eabec006
...
...
@@ -11,7 +11,7 @@ import { URI } from 'vs/base/common/uri';
import
{
IReference
,
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
telemetryURIDescriptor
}
from
'
vs/platform/telemetry/common/telemetryUtils
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
marked
}
from
'
vs/base/common/marked/marked
'
;
import
*
as
marked
from
'
vs/base/common/marked/marked
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
IHashService
}
from
'
vs/workbench/services/hash/common/hashService
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录