X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fentities%2Fplugin.js;h=8dac27fd2172842b71d31f5a68dad4f00c9d2da5;hb=4e70ea24db840898be8cc21c950363a52a2a6aba;hp=3c267650eab817af4e61299c9f6a8cf9458d17ca;hpb=48b1db88210b4160dce439c6e3e32e14af8c106b;p=ckeditor.git diff --git a/_source/plugins/entities/plugin.js b/_source/plugins/entities/plugin.js index 3c26765..8dac27f 100644 --- a/_source/plugins/entities/plugin.js +++ b/_source/plugins/entities/plugin.js @@ -6,7 +6,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license (function() { // Base HTML entities. - var htmlbase = 'nbsp,gt,lt'; + var htmlbase = 'nbsp,gt,lt,amp'; var entities = // Latin-1 Entities @@ -61,7 +61,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license nbsp : '\u00A0', // IE | FF shy : '\u00AD', // IE gt : '\u003E', // IE | FF | -- | Opera - lt : '\u003C' // IE | FF | Safari | Opera + lt : '\u003C', // IE | FF | Safari | Opera + amp : '\u0026' // ALL }; entities = entities.replace( /\b(nbsp|shy|gt|lt|amp)(?:,|$)/g, function( match, entity ) @@ -113,7 +114,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( htmlFilter ) { // Mandatory HTML base entities. - var selectedEntities = htmlbase; + var selectedEntities = ''; + + if ( config.basicEntities !== false ) + selectedEntities += htmlbase; if ( config.entities ) { @@ -130,8 +134,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var entitiesTable = buildTable( selectedEntities ); - // Create the Regex used to find entities in the text. - var entitiesRegex = '[' + entitiesTable.regex + ']'; + // Create the Regex used to find entities in the text, leave it matches nothing if entities are empty. + var entitiesRegex = entitiesTable.regex ? '[' + entitiesTable.regex + ']' : 'a^'; delete entitiesTable.regex; if ( config.entities && config.entities_processNumerical ) @@ -170,7 +174,24 @@ For licensing, see LICENSE.html or http://ckeditor.com/license })(); /** + * Whether to escape HTML preserved entities in text, including: + * + * Note: It should not be subjected to change unless you're outputting non-HTML data format like BBCode. + * @type Boolean + * @default true + * @example + * config.basicEntities = false; + */ +CKEDITOR.config.basicEntities = true; + +/** * Whether to use HTML entities in the output. + * @name CKEDITOR.config.entities * @type Boolean * @default true * @example @@ -182,6 +203,7 @@ CKEDITOR.config.entities = true; * Whether to convert some Latin characters (Latin alphabet No. 1, ISO 8859-1) * to HTML entities. The list of entities can be found at the * W3C HTML 4.01 Specification, section 24.2.1. + * @name CKEDITOR.config.entities_latin * @type Boolean * @default true * @example @@ -194,6 +216,7 @@ CKEDITOR.config.entities_latin = true; * HTML entities. This may be more relevant for users typing text written in Greek. * The list of entities can be found at the * W3C HTML 4.01 Specification, section 24.3.1. + * @name CKEDITOR.config.entities_greek * @type Boolean * @default true * @example @@ -207,7 +230,7 @@ CKEDITOR.config.entities_greek = true; * When specified as the value 'force', it will simply convert all entities into the above form. * For example, the phrase "This is Chinese: 汉语." is outputted * as "This is Chinese: 汉语." - * @type Boolean + * @name CKEDITOR.config.entities_processNumerical * @type Boolean|String * @default false * @example @@ -219,6 +242,7 @@ CKEDITOR.config.entities_greek = true; * An additional list of entities to be used. It's a string containing each * entry separated by a comma. Entities names or number must be used, exclusing * the "&" preffix and the ";" termination. + * @name CKEDITOR.config.entities_additional * @default '#39' // The single quote (') character. * @type String * @example