Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit 58a7009

Browse files
authored
Merge pull request #10 from ckeditor/i/5794
Other: XML and HTML will not be treated as the same language. Closes ckeditor/ckeditor5#5794.
2 parents f7a497d + d1516b8 commit 58a7009

File tree

8 files changed

+20
-12
lines changed

8 files changed

+20
-12
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div id="snippet-custom-languages">
22
<p>Put some text in the <code>&lt;body&gt;</code>:</p>
3-
<pre><code class="language-xml"><body>Hello world!</body></code></pre>
3+
<pre><code class="language-html"><body>Hello world!</body></code></pre>
44
<p>Then set the font color:</p>
55
<pre><code class="language-css">body { color: red }</code></pre>
66
</div>

docs/_snippets/features/code-block-custom-languages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ClassicEditor
3131
codeBlock: {
3232
languages: [
3333
{ language: 'css', label: 'CSS' },
34-
{ language: 'xml', label: 'HTML/XML' }
34+
{ language: 'html', label: 'HTML' }
3535
]
3636
}
3737
} )

docs/_snippets/features/code-block.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<textarea id="snippet-highlight">
22
&lt;h2>Getting started with CKEditor 5&lt;/h2>
33
&lt;p>First, create an HTML element with the initial content:&lt;/p>
4-
&lt;pre>&lt;code class="language-xml">&lt;div id="editor">
4+
&lt;pre>&lt;code class="language-html">&lt;div id="editor">
55
&lt;p&gt;Here goes the initial content of the editor.&lt;/p&gt;
66
&lt;/div>&lt;/code>&lt;/pre>
77

docs/features/code-blocks.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ Each code block can be assigned a programming language. The language of the code
2424
<pre><code class="language-javascript">window.alert( 'Hello world!' )</code></pre>
2525
```
2626

27-
It is possible to configure which languages are available to the users. You can use the {@link module:code-block/codeblock~CodeBlockConfig#languages `codeBlock.languages`} configuration and define your own languages. For example, the following editor supports only two languages (CSS and XML/HTML):
27+
It is possible to configure which languages are available to the users. You can use the {@link module:code-block/codeblock~CodeBlockConfig#languages `codeBlock.languages`} configuration and define your own languages. For example, the following editor supports only two languages (CSS and HTML):
2828

2929
```js
3030
ClassicEditor
3131
.create( document.querySelector( '#editor' ), {
3232
codeBlock: {
3333
languages: [
3434
{ language: 'css', label: 'CSS' },
35-
{ language: 'xml', label: 'HTML/XML' }
35+
{ language: 'html', label: 'HTML' }
3636
]
3737
}
3838
} )
@@ -166,13 +166,14 @@ The {@link module:code-block/codeblock~CodeBlock} plugin registers:
166166
{ language: 'cpp', label: 'C++' },
167167
{ language: 'css', label: 'CSS' },
168168
{ language: 'diff', label: 'Diff' },
169-
{ language: 'xml', label: 'HTML/XML' },
169+
{ language: 'html', label: 'HTML' },
170170
{ language: 'java', label: 'Java' },
171171
{ language: 'javascript', label: 'JavaScript' },
172172
{ language: 'php', label: 'PHP' },
173173
{ language: 'python', label: 'Python' },
174174
{ language: 'ruby', label: 'Ruby' },
175175
{ language: 'typescript', label: 'TypeScript' },
176+
{ language: 'xml', label: 'XML' }
176177
]
177178
```
178179

src/codeblock.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,14 @@ export default class CodeBlock extends Plugin {
137137
* { language: 'cpp', label: 'C++' },
138138
* { language: 'css', label: 'CSS' },
139139
* { language: 'diff', label: 'Diff' },
140-
* { language: 'xml', label: 'HTML/XML' },
140+
* { language: 'html', label: 'HTML' },
141141
* { language: 'java', label: 'Java' },
142142
* { language: 'javascript', label: 'JavaScript' },
143143
* { language: 'php', label: 'PHP' },
144144
* { language: 'python', label: 'Python' },
145145
* { language: 'ruby', label: 'Ruby' },
146146
* { language: 'typescript', label: 'TypeScript' },
147+
* { language: 'xml', label: 'XML' }
147148
* ]
148149
*
149150
* **Note**: The first language defined in the configuration is considered the default one. This means it will be

src/codeblockediting.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ export default class CodeBlockEditing extends Plugin {
6161
{ language: 'cpp', label: 'C++' },
6262
{ language: 'css', label: 'CSS' },
6363
{ language: 'diff', label: 'Diff' },
64-
{ language: 'xml', label: 'HTML/XML' },
64+
{ language: 'html', label: 'HTML' },
6565
{ language: 'java', label: 'Java' },
6666
{ language: 'javascript', label: 'JavaScript' },
6767
{ language: 'php', label: 'PHP' },
6868
{ language: 'python', label: 'Python' },
6969
{ language: 'ruby', label: 'Ruby' },
70-
{ language: 'typescript', label: 'TypeScript' }
70+
{ language: 'typescript', label: 'TypeScript' },
71+
{ language: 'xml', label: 'XML' }
7172
],
7273

7374
// A single tab.

tests/codeblockediting.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,14 @@ describe( 'CodeBlockEditing', () => {
8383
{ language: 'cpp', label: 'C++' },
8484
{ language: 'css', label: 'CSS' },
8585
{ language: 'diff', label: 'Diff' },
86-
{ language: 'xml', label: 'HTML/XML' },
86+
{ language: 'html', label: 'HTML' },
8787
{ language: 'java', label: 'Java' },
8888
{ language: 'javascript', label: 'JavaScript' },
8989
{ language: 'php', label: 'PHP' },
9090
{ language: 'python', label: 'Python' },
9191
{ language: 'ruby', label: 'Ruby' },
92-
{ language: 'typescript', label: 'TypeScript' }
92+
{ language: 'typescript', label: 'TypeScript' },
93+
{ language: 'xml', label: 'XML' }
9394
] );
9495
} );
9596
} );

tests/codeblockui.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describe( 'CodeBlockUI', () => {
121121
withText: true
122122
},
123123
{
124-
label: 'HTML/XML',
124+
label: 'HTML',
125125
withText: true
126126
},
127127
{
@@ -147,6 +147,10 @@ describe( 'CodeBlockUI', () => {
147147
{
148148
label: 'TypeScript',
149149
withText: true
150+
},
151+
{
152+
label: 'XML',
153+
withText: true
150154
}
151155
] );
152156
} );

0 commit comments

Comments
 (0)