mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Allow all characters (except astral) specified in XML specs. fixes #2329
This commit is contained in:
1 parent
fc96f31fad
commit
a2b471e098
3 files changed
+7
-3
No files matched your search
@@ -151,6 +151,8 @@ var DOMPropertyInjection = {
|
||||
};
|
||||
var defaultValueCache = {};
|
||||
|
||||
var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
|
||||
|
||||
/**
|
||||
* DOMProperty exports lookup objects that can be used like functions:
|
||||
*
|
||||
@@ -168,6 +170,9 @@ var DOMProperty = {
|
||||
|
||||
ID_ATTRIBUTE_NAME: 'data-reactid',
|
||||
|
||||
ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,
|
||||
ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\uB7\\u0300-\\u036F\\u203F-\\u2040',
|
||||
|
||||
/**
|
||||
* Map from property "standard name" to an object with info about how to set
|
||||
* the property in the DOM. Each object contains:
|
||||
|
||||
@@ -18,8 +18,7 @@ var ReactPerf = require('ReactPerf');
|
||||
var quoteAttributeValueForBrowser = require('quoteAttributeValueForBrowser');
|
||||
var warning = require('warning');
|
||||
|
||||
// Simplified subset
|
||||
var VALID_ATTRIBUTE_NAME_REGEX = /^[a-zA-Z_][\w\.\-]*$/;
|
||||
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
|
||||
var illegalAttributeNameCache = {};
|
||||
var validatedAttributeNameCache = {};
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ if (ExecutionEnvironment.canUseDOM) {
|
||||
|
||||
var HTMLDOMPropertyConfig = {
|
||||
isCustomAttribute: RegExp.prototype.test.bind(
|
||||
/^(data|aria)-[a-z_][a-z\d_.\-]*$/
|
||||
new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')
|
||||
),
|
||||
Properties: {
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user