From a66d3045fc7134a2e356f7c237cd53603e877c01 Mon Sep 17 00:00:00 2001 From: Mateusz Uzdowski Date: Thu, 4 Feb 2010 21:44:03 +0000 Subject: [PATCH] BUGFIX: allow all characters in the anchor's name attributes git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98252 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/tiny_mce_improvements.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/javascript/tiny_mce_improvements.js b/javascript/tiny_mce_improvements.js index 7482ab087..56db27bec 100755 --- a/javascript/tiny_mce_improvements.js +++ b/javascript/tiny_mce_improvements.js @@ -74,7 +74,9 @@ LinkForm.prototype = { // this function collects the anchors in the currently active editor and regenerates the dropdown var refreshAnchors = function(selector) { var anchors = new Array(); - var raw = tinyMCE.activeEditor.getContent().match(/name="([a-zA-Z0-9-_]+?)"/gim); + // name attribute is defined as CDATA, should accept all characters and entities + // http://www.w3.org/TR/1999/REC-html401-19991224/struct/links.html#h-12.2 + var raw = tinyMCE.activeEditor.getContent().match(/name="([^"]+?)"|name='([^']+?)'/gim); if (raw && raw.length) { for(var i = 0; i < raw.length; i++) { anchors.push(raw[i].substr(6).replace(/"$/, ''));