浏览代码

Uses the right method setAttribute.

Works better, and the html elements get their attributes.
VonC 11 年之前
父节点
当前提交
d20760f40d
共有 1 个文件被更改,包括 2 次插入2 次删除
  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 + "'");
 				}
 			}
 		}