1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 00:12:29 +03:00

Arrays add <ol> elements.

This commit is contained in:
Rob Rix 2015-10-13 11:15:23 -04:00
parent 208238ae6e
commit 69568fb622

View File

@ -35,12 +35,14 @@
}
function toDOM(json) {
var node = document.createElement("div");
var node;
if (json instanceof Array) {
node = document.createElement("ol");
for (index in json) {
node.appendChild(toDOM(json[index]));
}
} else if (json instanceof Object) {
node = document.createElement("div");
if (json['source'] != null) {
node.textContent = json['source'];
} else if (json['insert'] != null) {