1
1
mirror of https://github.com/github/semantic.git synced 2024-12-27 00:44:57 +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) { function toDOM(json) {
var node = document.createElement("div"); var node;
if (json instanceof Array) { if (json instanceof Array) {
node = document.createElement("ol");
for (index in json) { for (index in json) {
node.appendChild(toDOM(json[index])); node.appendChild(toDOM(json[index]));
} }
} else if (json instanceof Object) { } else if (json instanceof Object) {
node = document.createElement("div");
if (json['source'] != null) { if (json['source'] != null) {
node.textContent = json['source']; node.textContent = json['source'];
} else if (json['insert'] != null) { } else if (json['insert'] != null) {