Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
c780ebab
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,发现更多精彩内容 >>
未验证
提交
c780ebab
编写于
11月 20, 2019
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use   instead of to support XHTML (fixes microsoft/monaco-editor#1492)
上级
29a2c568
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
28 addition
and
28 deletion
+28
-28
src/vs/base/browser/ui/inputbox/inputBox.ts
src/vs/base/browser/ui/inputbox/inputBox.ts
+2
-2
src/vs/editor/browser/config/charWidthReader.ts
src/vs/editor/browser/config/charWidthReader.ts
+1
-1
src/vs/editor/browser/widget/diffReview.ts
src/vs/editor/browser/widget/diffReview.ts
+3
-3
src/vs/editor/common/modes/textToHtmlTokenizer.ts
src/vs/editor/common/modes/textToHtmlTokenizer.ts
+2
-2
src/vs/editor/contrib/codelens/codelensWidget.ts
src/vs/editor/contrib/codelens/codelensWidget.ts
+2
-2
src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts
src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts
+18
-18
未找到文件。
src/vs/base/browser/ui/inputbox/inputBox.ts
浏览文件 @
c780ebab
...
...
@@ -171,7 +171,7 @@ export class InputBox extends Widget {
this
.
maxHeight
=
typeof
this
.
options
.
flexibleMaxHeight
===
'
number
'
?
this
.
options
.
flexibleMaxHeight
:
Number
.
POSITIVE_INFINITY
;
this
.
mirror
=
dom
.
append
(
wrapper
,
$
(
'
div.mirror
'
));
this
.
mirror
.
innerHTML
=
'
&
nbsp
;
'
;
this
.
mirror
.
innerHTML
=
'
&
#160
;
'
;
this
.
scrollableElement
=
new
ScrollableElement
(
this
.
element
,
{
vertical
:
ScrollbarVisibility
.
Auto
});
...
...
@@ -529,7 +529,7 @@ export class InputBox extends Widget {
if
(
mirrorTextContent
)
{
this
.
mirror
.
textContent
=
value
+
suffix
;
}
else
{
this
.
mirror
.
innerHTML
=
'
&
nbsp
;
'
;
this
.
mirror
.
innerHTML
=
'
&
#160
;
'
;
}
this
.
layout
();
...
...
src/vs/editor/browser/config/charWidthReader.ts
浏览文件 @
c780ebab
...
...
@@ -124,7 +124,7 @@ class DomCharWidthReader {
private
static
_render
(
testElement
:
HTMLElement
,
request
:
CharWidthRequest
):
void
{
if
(
request
.
chr
===
'
'
)
{
let
htmlString
=
'
&
nbsp
;
'
;
let
htmlString
=
'
&
#160
;
'
;
// Repeat character 256 (2^8) times
for
(
let
i
=
0
;
i
<
8
;
i
++
)
{
htmlString
+=
htmlString
;
...
...
src/vs/editor/browser/widget/diffReview.ts
浏览文件 @
c780ebab
...
...
@@ -695,7 +695,7 @@ export class DiffReview extends Disposable {
if
(
originalLine
!==
0
)
{
originalLineNumber
.
appendChild
(
document
.
createTextNode
(
String
(
originalLine
)));
}
else
{
originalLineNumber
.
innerHTML
=
'
&
nbsp
;
'
;
originalLineNumber
.
innerHTML
=
'
&
#160
;
'
;
}
cell
.
appendChild
(
originalLineNumber
);
...
...
@@ -707,13 +707,13 @@ export class DiffReview extends Disposable {
if
(
modifiedLine
!==
0
)
{
modifiedLineNumber
.
appendChild
(
document
.
createTextNode
(
String
(
modifiedLine
)));
}
else
{
modifiedLineNumber
.
innerHTML
=
'
&
nbsp
;
'
;
modifiedLineNumber
.
innerHTML
=
'
&
#160
;
'
;
}
cell
.
appendChild
(
modifiedLineNumber
);
const
spacer
=
document
.
createElement
(
'
span
'
);
spacer
.
className
=
spacerClassName
;
spacer
.
innerHTML
=
'
&
nbsp; 
;
'
;
spacer
.
innerHTML
=
'
&
#160; 
;
'
;
cell
.
appendChild
(
spacer
);
let
lineContent
:
string
;
...
...
src/vs/editor/common/modes/textToHtmlTokenizer.ts
浏览文件 @
c780ebab
...
...
@@ -46,7 +46,7 @@ export function tokenizeLineToHTML(text: string, viewLineTokens: IViewLineTokens
let
insertSpacesCount
=
tabSize
-
(
charIndex
+
tabsCharDelta
)
%
tabSize
;
tabsCharDelta
+=
insertSpacesCount
-
1
;
while
(
insertSpacesCount
>
0
)
{
partContent
+=
useNbsp
?
'
&
nbsp
;
'
:
'
'
;
partContent
+=
useNbsp
?
'
&
#160
;
'
:
'
'
;
insertSpacesCount
--
;
}
break
;
...
...
@@ -78,7 +78,7 @@ export function tokenizeLineToHTML(text: string, viewLineTokens: IViewLineTokens
break
;
case
CharCode
.
Space
:
partContent
+=
useNbsp
?
'
&
nbsp
;
'
:
'
'
;
partContent
+=
useNbsp
?
'
&
#160
;
'
:
'
'
;
break
;
default
:
...
...
src/vs/editor/contrib/codelens/codelensWidget.ts
浏览文件 @
c780ebab
...
...
@@ -96,7 +96,7 @@ class CodeLensContentWidget implements editorBrowser.IContentWidget {
innerHtml
+=
`<span>
${
title
}
</span>`
;
}
if
(
i
+
1
<
lenses
.
length
)
{
innerHtml
+=
'
<span>&
nbsp;| 
;</span>
'
;
innerHtml
+=
'
<span>&
#160;| 
;</span>
'
;
}
}
}
...
...
@@ -108,7 +108,7 @@ class CodeLensContentWidget implements editorBrowser.IContentWidget {
}
else
{
// symbols and commands
if
(
!
innerHtml
)
{
innerHtml
=
'
&
nbsp
;
'
;
innerHtml
=
'
&
#160
;
'
;
}
this
.
_domNode
.
innerHTML
=
innerHtml
;
if
(
this
.
_isEmpty
&&
animate
)
{
...
...
src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts
浏览文件 @
c780ebab
...
...
@@ -109,9 +109,9 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
[
'
<div>
'
,
'
<span style="color: #ff0000;font-style: italic;font-weight: bold;">Ciao</span>
'
,
'
<span style="color: #000000;">&
nbsp
;</span>
'
,
'
<span style="color: #000000;">&
#160
;</span>
'
,
'
<span style="color: #00ff00;">hello</span>
'
,
'
<span style="color: #000000;">&
nbsp
;</span>
'
,
'
<span style="color: #000000;">&
#160
;</span>
'
,
'
<span style="color: #0000ff;text-decoration: underline;">world!</span>
'
,
'
</div>
'
].
join
(
''
)
...
...
@@ -122,9 +122,9 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
[
'
<div>
'
,
'
<span style="color: #ff0000;font-style: italic;font-weight: bold;">Ciao</span>
'
,
'
<span style="color: #000000;">&
nbsp
;</span>
'
,
'
<span style="color: #000000;">&
#160
;</span>
'
,
'
<span style="color: #00ff00;">hello</span>
'
,
'
<span style="color: #000000;">&
nbsp
;</span>
'
,
'
<span style="color: #000000;">&
#160
;</span>
'
,
'
<span style="color: #0000ff;text-decoration: underline;">w</span>
'
,
'
</div>
'
].
join
(
''
)
...
...
@@ -135,9 +135,9 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
[
'
<div>
'
,
'
<span style="color: #ff0000;font-style: italic;font-weight: bold;">Ciao</span>
'
,
'
<span style="color: #000000;">&
nbsp
;</span>
'
,
'
<span style="color: #000000;">&
#160
;</span>
'
,
'
<span style="color: #00ff00;">hello</span>
'
,
'
<span style="color: #000000;">&
nbsp
;</span>
'
,
'
<span style="color: #000000;">&
#160
;</span>
'
,
'
</div>
'
].
join
(
''
)
);
...
...
@@ -147,9 +147,9 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
[
'
<div>
'
,
'
<span style="color: #ff0000;font-style: italic;font-weight: bold;">iao</span>
'
,
'
<span style="color: #000000;">&
nbsp
;</span>
'
,
'
<span style="color: #000000;">&
#160
;</span>
'
,
'
<span style="color: #00ff00;">hello</span>
'
,
'
<span style="color: #000000;">&
nbsp
;</span>
'
,
'
<span style="color: #000000;">&
#160
;</span>
'
,
'
</div>
'
].
join
(
''
)
);
...
...
@@ -158,9 +158,9 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
tokenizeLineToHTML
(
text
,
lineTokens
,
colorMap
,
4
,
11
,
4
,
true
),
[
'
<div>
'
,
'
<span style="color: #000000;">&
nbsp
;</span>
'
,
'
<span style="color: #000000;">&
#160
;</span>
'
,
'
<span style="color: #00ff00;">hello</span>
'
,
'
<span style="color: #000000;">&
nbsp
;</span>
'
,
'
<span style="color: #000000;">&
#160
;</span>
'
,
'
</div>
'
].
join
(
''
)
);
...
...
@@ -170,7 +170,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
[
'
<div>
'
,
'
<span style="color: #00ff00;">hello</span>
'
,
'
<span style="color: #000000;">&
nbsp
;</span>
'
,
'
<span style="color: #000000;">&
#160
;</span>
'
,
'
</div>
'
].
join
(
''
)
);
...
...
@@ -241,11 +241,11 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
tokenizeLineToHTML
(
text
,
lineTokens
,
colorMap
,
0
,
21
,
4
,
true
),
[
'
<div>
'
,
'
<span style="color: #000000;">&
nbsp; 
;</span>
'
,
'
<span style="color: #000000;">&
#160; 
;</span>
'
,
'
<span style="color: #ff0000;font-style: italic;font-weight: bold;">Ciao</span>
'
,
'
<span style="color: #000000;">&
nbsp;  
;</span>
'
,
'
<span style="color: #000000;">&
#160;  
;</span>
'
,
'
<span style="color: #00ff00;">hello</span>
'
,
'
<span style="color: #000000;">&
nbsp
;</span>
'
,
'
<span style="color: #000000;">&
#160
;</span>
'
,
'
<span style="color: #0000ff;text-decoration: underline;">world!</span>
'
,
'
</div>
'
].
join
(
''
)
...
...
@@ -255,11 +255,11 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
tokenizeLineToHTML
(
text
,
lineTokens
,
colorMap
,
0
,
17
,
4
,
true
),
[
'
<div>
'
,
'
<span style="color: #000000;">&
nbsp; 
;</span>
'
,
'
<span style="color: #000000;">&
#160; 
;</span>
'
,
'
<span style="color: #ff0000;font-style: italic;font-weight: bold;">Ciao</span>
'
,
'
<span style="color: #000000;">&
nbsp;  
;</span>
'
,
'
<span style="color: #000000;">&
#160;  
;</span>
'
,
'
<span style="color: #00ff00;">hello</span>
'
,
'
<span style="color: #000000;">&
nbsp
;</span>
'
,
'
<span style="color: #000000;">&
#160
;</span>
'
,
'
<span style="color: #0000ff;text-decoration: underline;">wo</span>
'
,
'
</div>
'
].
join
(
''
)
...
...
@@ -269,7 +269,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
tokenizeLineToHTML
(
text
,
lineTokens
,
colorMap
,
0
,
3
,
4
,
true
),
[
'
<div>
'
,
'
<span style="color: #000000;">&
nbsp; 
;</span>
'
,
'
<span style="color: #000000;">&
#160; 
;</span>
'
,
'
<span style="color: #ff0000;font-style: italic;font-weight: bold;">C</span>
'
,
'
</div>
'
].
join
(
''
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录