Merge pull request #3453 from JankariTech/fixVariablesTypos
fix typos in variable names
This commit is contained in:
commit
af1cd9d6a4
1 changed files with 5 additions and 5 deletions
|
|
@ -313,17 +313,17 @@ const Plugin = () => {
|
||||||
*/
|
*/
|
||||||
function addAttributeInElement( node, elementTarget, separator ) {
|
function addAttributeInElement( node, elementTarget, separator ) {
|
||||||
|
|
||||||
var mardownClassesInElementsRegex = new RegExp( separator, 'mg' );
|
var markdownClassesInElementsRegex = new RegExp( separator, 'mg' );
|
||||||
var mardownClassRegex = new RegExp( "([^\"= ]+?)=\"([^\"]+?)\"|(data-[^\"= ]+?)(?=[\" ])", 'mg' );
|
var markdownClassRegex = new RegExp( "([^\"= ]+?)=\"([^\"]+?)\"|(data-[^\"= ]+?)(?=[\" ])", 'mg' );
|
||||||
var nodeValue = node.nodeValue;
|
var nodeValue = node.nodeValue;
|
||||||
var matches,
|
var matches,
|
||||||
matchesClass;
|
matchesClass;
|
||||||
if( matches = mardownClassesInElementsRegex.exec( nodeValue ) ) {
|
if( matches = markdownClassesInElementsRegex.exec( nodeValue ) ) {
|
||||||
|
|
||||||
var classes = matches[1];
|
var classes = matches[1];
|
||||||
nodeValue = nodeValue.substring( 0, matches.index ) + nodeValue.substring( mardownClassesInElementsRegex.lastIndex );
|
nodeValue = nodeValue.substring( 0, matches.index ) + nodeValue.substring( markdownClassesInElementsRegex.lastIndex );
|
||||||
node.nodeValue = nodeValue;
|
node.nodeValue = nodeValue;
|
||||||
while( matchesClass = mardownClassRegex.exec( classes ) ) {
|
while( matchesClass = markdownClassRegex.exec( classes ) ) {
|
||||||
if( matchesClass[2] ) {
|
if( matchesClass[2] ) {
|
||||||
elementTarget.setAttribute( matchesClass[1], matchesClass[2] );
|
elementTarget.setAttribute( matchesClass[1], matchesClass[2] );
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue