浏览代码

Docs: Improved the docs of config.codeBlock.languages.

Aleksander Nowodzinski 5 年之前
父节点
当前提交
40bdb4b518

+ 2 - 1
packages/ckeditor5-code-block/docs/features/code-blocks.md

@@ -55,7 +55,8 @@ ClassicEditor
 				// Use the "php-code" class for PHP code blocks.
 				{ language: 'php', label: 'PHP', class: 'php-code' },
 
-				// Use the "js" class for JavaScript code blocks (the first class is defining).
+				// Use the "js" class for JavaScript code blocks.
+				// Note that only the first ("js") class will determine the language of the block when loading data.
 				{ language: 'javascript', label: 'JavaScript', class: 'js javascript js-code' },
 
 				// Python code blocks will have the default "language-python" CSS class.

+ 4 - 3
packages/ckeditor5-code-block/src/codeblock.js

@@ -51,7 +51,7 @@ export default class CodeBlock extends Plugin {
  *
  *		ClassicEditor
  *			.create( editorElement, {
- * 				codeBlock:  ... // The code block feature configuration.
+ *				codeBlock:  ... // The code block feature configuration.
  *			} )
  *			.then( ... )
  *			.catch( ... );
@@ -111,12 +111,13 @@ export default class CodeBlock extends Plugin {
  *				codeBlock: {
  *					languages: [
  *						// Do not render the CSS class for the plain text code blocks.
- * 						{ language: 'plaintext', label: 'Plain text', class: '' },
+ *						{ language: 'plaintext', label: 'Plain text', class: '' },
  *
  *						// Use the "php-code" class for PHP code blocks.
  *						{ language: 'php', label: 'PHP', class: 'php-code' },
  *
- * 						// Use the "js" class for JavaScript code blocks (the first class is defining).
+ *						// Use the "js" class for JavaScript code blocks.
+ *						// Note that only the first ("js") class will determine the language of the block when loading data.
  *						{ language: 'javascript', label: 'JavaScript', class: 'js javascript js-code' },
  *
  *						// Python code blocks will have the default "language-python" CSS class.