Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
3fb0d025
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,发现更多精彩内容 >>
提交
3fb0d025
编写于
6月 14, 2017
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update marked version
Fixes Microsoft/vscode-internalbacklog#40
上级
8c6f1b29
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
40 addition
and
29 deletion
+40
-29
src/vs/base/common/marked/OSSREADME.json
src/vs/base/common/marked/OSSREADME.json
+1
-1
src/vs/base/common/marked/raw.marked.js
src/vs/base/common/marked/raw.marked.js
+39
-28
未找到文件。
src/vs/base/common/marked/OSSREADME.json
浏览文件 @
3fb0d025
...
...
@@ -3,6 +3,6 @@
[{
"name"
:
"chjj-marked"
,
"repositoryURL"
:
"https://github.com/npmcomponent/chjj-marked"
,
"version"
:
"0.3.
2
"
,
"version"
:
"0.3.
6
"
,
"license"
:
"MIT"
}]
src/vs/base/common/marked/raw.marked.js
浏览文件 @
3fb0d025
/**
* marked - a markdown parser
* Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
...
...
@@ -78,8 +77,9 @@ block.normal = merge({}, block);
*/
block
.
gfm
=
merge
({},
block
.
normal
,
{
fences
:
/^ *
(
`
{3,}
|~
{3,})
*
(\S
+
)?
*
\n([\s\S]
+
?)\s
*
\1
*
(?:\n
+|$
)
/
,
paragraph
:
/^/
fences
:
/^ *
(
`
{3,}
|~
{3,})[
\.]
*
(\S
+
)?
*
\n([\s\S]
*
?)\s
*
\1
*
(?:\n
+|$
)
/
,
paragraph
:
/^/
,
heading
:
/^ *
(
#
{1,6})
+
([^\n]
+
?)
*#* *
(?:\n
+|$
)
/
});
block
.
gfm
.
paragraph
=
replace
(
block
.
paragraph
)
...
...
@@ -191,7 +191,7 @@ Lexer.prototype.token = function(src, top, bq) {
this
.
tokens
.
push
({
type
:
'
code
'
,
lang
:
cap
[
2
],
text
:
cap
[
3
]
text
:
cap
[
3
]
||
''
});
continue
;
}
...
...
@@ -362,7 +362,8 @@ Lexer.prototype.token = function(src, top, bq) {
type
:
this
.
options
.
sanitize
?
'
paragraph
'
:
'
html
'
,
pre
:
cap
[
1
]
===
'
pre
'
||
cap
[
1
]
===
'
script
'
||
cap
[
1
]
===
'
style
'
,
pre
:
!
this
.
options
.
sanitizer
&&
(
cap
[
1
]
===
'
pre
'
||
cap
[
1
]
===
'
script
'
||
cap
[
1
]
===
'
style
'
),
text
:
cap
[
0
]
});
continue
;
...
...
@@ -457,7 +458,7 @@ var inline = {
reflink
:
/^!
?\[(
inside
)\]\s
*
\[([^\]]
*
)\]
/
,
nolink
:
/^!
?\[((?:\[[^\]]
*
\]
|
[^\[\]])
*
)\]
/
,
strong
:
/^__
([\s\S]
+
?)
__
(?!
_
)
|^
\*\*([\s\S]
+
?)\*\*(?!\*)
/
,
em
:
/^
\b
_
((?:
__|
[\s\S]
)
+
?)
_
\b
|^
\*((?:\*\*
|
[\s\S])
+
?)\*(?!\*)
/
,
em
:
/^
\b
_
((?:
[^
_
]
|__
)
+
?)
_
\b
|^
\*((?:\*\*
|
[\s\S])
+
?)\*(?!\*)
/
,
code
:
/^
(
`+
)\s
*
([\s\S]
*
?[^
`
])\s
*
\1(?!
`
)
/
,
br
:
/^
{2,}\n(?!\s
*$
)
/
,
del
:
noop
,
...
...
@@ -609,8 +610,10 @@ InlineLexer.prototype.output = function(src) {
}
src
=
src
.
substring
(
cap
[
0
].
length
);
out
+=
this
.
options
.
sanitize
?
escape
(
cap
[
0
])
:
cap
[
0
];
?
this
.
options
.
sanitizer
?
this
.
options
.
sanitizer
(
cap
[
0
])
:
escape
(
cap
[
0
])
:
cap
[
0
]
continue
;
}
...
...
@@ -681,7 +684,7 @@ InlineLexer.prototype.output = function(src) {
// text
if
(
cap
=
this
.
rules
.
text
.
exec
(
src
))
{
src
=
src
.
substring
(
cap
[
0
].
length
);
out
+=
escape
(
this
.
smartypants
(
cap
[
0
]
));
out
+=
this
.
renderer
.
text
(
escape
(
this
.
smartypants
(
cap
[
0
])
));
continue
;
}
...
...
@@ -710,24 +713,24 @@ InlineLexer.prototype.outputLink = function(cap, link) {
/**
* Smartypants Transformations
*/
// TODO MonacoChange: Our build fails over the following lines if they are not commented out
InlineLexer
.
prototype
.
smartypants
=
function
(
text
)
{
return
text
;
// if (!this.options.smartypants) return text;
// return text
// // em-dashes
// .replace(/--/g, '\u2014')
// // opening singles
// .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018')
// // closing singles & apostrophes
// .replace(/'/g, '\u2019')
// // opening doubles
// .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c')
// // closing doubles
// .replace(/"/g, '\u201d')
// // ellipses
// .replace(/\.{3}/g, '\u2026');
// END MonacoChange
if
(
!
this
.
options
.
smartypants
)
return
text
;
return
text
// em-dashes
.
replace
(
/---/g
,
'
\
u2014
'
)
// en-dashes
.
replace
(
/--/g
,
'
\
u2013
'
)
// opening singles
.
replace
(
/
(
^|
[
-
\u
2014
/
(
\[
{"
\s])
'/g
,
'
$1
\
u2018
'
)
// closing singles & apostrophes
.
replace
(
/'/g
,
'
\
u2019
'
)
// opening doubles
.
replace
(
/
(
^|
[
-
\u
2014
/
(
\[
{
\u
2018
\s])
"/g
,
'
$1
\
u201c
'
)
// closing doubles
.
replace
(
/"/g
,
'
\
u201d
'
)
// ellipses
.
replace
(
/
\.{3}
/g
,
'
\
u2026
'
);
};
/**
...
...
@@ -735,6 +738,7 @@ InlineLexer.prototype.smartypants = function(text) {
*/
InlineLexer
.
prototype
.
mangle
=
function
(
text
)
{
if
(
!
this
.
options
.
mangle
)
return
text
;
var
out
=
''
,
l
=
text
.
length
,
i
=
0
...
...
@@ -873,7 +877,7 @@ Renderer.prototype.link = function(href, title, text) {
}
catch
(
e
)
{
return
''
;
}
if
(
prot
.
indexOf
(
'
javascript:
'
)
===
0
)
{
if
(
prot
.
indexOf
(
'
javascript:
'
)
===
0
||
prot
.
indexOf
(
'
vbscript:
'
)
===
0
||
prot
.
indexOf
(
'
data:
'
)
===
0
)
{
return
''
;
}
}
...
...
@@ -894,6 +898,10 @@ Renderer.prototype.image = function(href, title, text) {
return
out
;
};
Renderer
.
prototype
.
text
=
function
(
text
)
{
return
text
;
};
/**
* Parsing & Compiling
*/
...
...
@@ -1088,7 +1096,8 @@ function escape(html, encode) {
}
function
unescape
(
html
)
{
return
html
.
replace
(
/&
([
#
\w]
+
)
;/g
,
function
(
_
,
n
)
{
// explicitly match decimal, hex, and named HTML entities
return
html
.
replace
(
/&
(
#
(?:\d
+
)
|
(?:
#x
[
0-9A-Fa-f
]
+
)
|
(?:\w
+
))
;
?
/g
,
function
(
_
,
n
)
{
n
=
n
.
toLowerCase
();
if
(
n
===
'
colon
'
)
return
'
:
'
;
if
(
n
.
charAt
(
0
)
===
'
#
'
)
{
...
...
@@ -1237,6 +1246,8 @@ marked.defaults = {
breaks
:
false
,
pedantic
:
false
,
sanitize
:
false
,
sanitizer
:
null
,
mangle
:
true
,
smartLists
:
false
,
silent
:
false
,
highlight
:
null
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录