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
This commit is contained in:
Mateusz Uzdowski 2010-02-04 21:44:03 +00:00 committed by Sam Minnee
parent f31ec616a7
commit a66d3045fc

View File

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