Uses the right method setAttribute.
authorVonC <vonc@laposte.net>
Fri, 25 Oct 2013 21:18:10 +0000 (23:18 +0200)
committerVonC <vonc@laposte.net>
Sun, 27 Oct 2013 21:49:42 +0000 (22:49 +0100)
Works better, and the html elements get their attributes.

plugin/markdown/markdown.js

index 3b71c42774b723ed4e46488ba0e2a116c94615c9..a36e34f5408f1fecc1deec4659e5b172315d2424 100755 (executable)
 
                                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 + "'");
                                }
                        }
                }