BUGFIX: allow all characters in the anchor's name attributes (from r98252)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102635 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-13 03:17:32 +00:00
parent b73d75f907
commit ee1fda176b

View File

@ -72,7 +72,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(/"$/, ''));