Bladeren bron

Uses the right method setAttribute.

Works better, and the html elements get their attributes.
VonC 11 jaren geleden
bovenliggende
commit
d20760f40d
1 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 2 2
      plugin/markdown/markdown.js

+ 2 - 2
plugin/markdown/markdown.js

@@ -297,8 +297,8 @@
 
 				while( matchesClass = mardownClassRegex.exec( classes ) ) {
 					console.log("attr='" + matchesClass[1] + "'='" + matchesClass[2] + "'");
-					element.parentNode.attributes[matchesClass[1]] = matchesClass[2];
-					console.log("=>'" + element.parentNode.attributes[matchesClass[1]] + "'");
+					element.parentNode.setAttribute(matchesClass[1], matchesClass[2]);
+					console.log("=>'" + element.parentNode.attributes[matchesClass[1]].nodeValue + "'");
 				}
 			}
 		}