This commit is contained in:
Peng Lyu 2019-08-26 11:16:04 -07:00
parent 74f7fee9a3
commit 237b9f3487
2 changed files with 19 additions and 19 deletions

View file

@ -78,7 +78,7 @@ export function tokenizeLineToHTML(text: string, viewLineTokens: IViewLineTokens
break;
case CharCode.Space:
partContent += '&nbsp';
partContent += ' ';
break;
default:

View file

@ -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;">&nbsp;</span>',
'<span style="color: #00ff00;">hello</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</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;">&nbsp;</span>',
'<span style="color: #00ff00;">hello</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</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;">&nbsp;</span>',
'<span style="color: #00ff00;">hello</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</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;">&nbsp;</span>',
'<span style="color: #00ff00;">hello</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</span>',
'</div>'
].join('')
);
@ -158,9 +158,9 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
tokenizeLineToHTML(text, lineTokens, colorMap, 4, 11, 4),
[
'<div>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</span>',
'<span style="color: #00ff00;">hello</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</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;">&nbsp;</span>',
'</div>'
].join('')
);
@ -241,11 +241,11 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
tokenizeLineToHTML(text, lineTokens, colorMap, 0, 21, 4),
[
'<div>',
'<span style="color: #000000;">&nbsp&nbsp</span>',
'<span style="color: #000000;">&nbsp;&nbsp;</span>',
'<span style="color: #ff0000;font-style: italic;font-weight: bold;">Ciao</span>',
'<span style="color: #000000;">&nbsp&nbsp&nbsp</span>',
'<span style="color: #000000;">&nbsp;&nbsp;&nbsp;</span>',
'<span style="color: #00ff00;">hello</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</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),
[
'<div>',
'<span style="color: #000000;">&nbsp&nbsp</span>',
'<span style="color: #000000;">&nbsp;&nbsp;</span>',
'<span style="color: #ff0000;font-style: italic;font-weight: bold;">Ciao</span>',
'<span style="color: #000000;">&nbsp&nbsp&nbsp</span>',
'<span style="color: #000000;">&nbsp;&nbsp;&nbsp;</span>',
'<span style="color: #00ff00;">hello</span>',
'<span style="color: #000000;">&nbsp</span>',
'<span style="color: #000000;">&nbsp;</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),
[
'<div>',
'<span style="color: #000000;">&nbsp&nbsp</span>',
'<span style="color: #000000;">&nbsp;&nbsp;</span>',
'<span style="color: #ff0000;font-style: italic;font-weight: bold;">C</span>',
'</div>'
].join('')