Skip to content

Commit 1af034e

Browse files
committed
committing before getting more from keriann
1 parent 3ff405c commit 1af034e

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

src/components/CodeSnippet.vue

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,16 @@ export default {
9393
nestedString += `<${child}/>\n`
9494
}
9595
else{
96-
nestedString += htmlElementMap[child.text][0]
97-
nestedString += '\n';
98-
nestedString += writeNested(child.children,indented)
99-
nestedString += indented + htmlElementMap[child.text][1]
100-
nestedString += '\n'
96+
if(child.children.length){
97+
nestedString += htmlElementMap[child.text][0]
98+
nestedString += '\n';
99+
nestedString += writeNested(child.children,indented)
100+
nestedString += indented + htmlElementMap[child.text][1]
101+
nestedString += '\n'
102+
}
103+
else{
104+
nestedString += htmlElementMap[child.text][0]+htmlElementMap[child.text][1]+'\n';
105+
}
101106
}
102107
})
103108
return nestedString
@@ -114,12 +119,17 @@ export default {
114119
}
115120
else{
116121
outputStr += ` `;
117-
outputStr += htmlElementMap[el.text][0];
118-
outputStr += '\n'
119-
outputStr += writeNested(el.children,` `)
120-
outputStr += ` `
121-
outputStr += htmlElementMap[el.text][1];
122-
outputStr += ` \n`;
122+
if(el.children.length){
123+
outputStr += htmlElementMap[el.text][0];
124+
outputStr += '\n'
125+
outputStr += writeNested(el.children,` `)
126+
outputStr += ` `
127+
outputStr += htmlElementMap[el.text][1];
128+
outputStr += ` \n`;
129+
}
130+
else{
131+
outputStr += htmlElementMap[el.text][0]+htmlElementMap[el.text][1]+'\n';
132+
}
123133
}
124134
}
125135
// console.log(`outputStr from writeTemplateTag: ${outputStr}`)

src/components/ComponentDisplay.vue

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,11 @@ export default {
138138
// console.log('component parent',component.parent)
139139
// console.log('component parent parent', component.parent.parent)
140140
if (!Object.keys(component.parent).length) return lineage;
141-
<<<<<<< HEAD
142141
for(var parents in component.parent) {
143142
//for each parent in our component
144143
// console.log('parents', parents)
145144
lineage.push(parents); //push the parent into lineage
146145
// console.log('lineage pre push', component, lineage)
147-
=======
148-
for (var parents in component.parent) {
149-
// for each parent in our component
150-
console.log('parents', parents)
151-
lineage.push(parents); // push the parent into lineage
152-
console.log('lineage pre push', component, lineage)
153-
>>>>>>> c3465a8ee7303f95f469f78b7ab5d89214b77193
154146
checkParents(component.parent[parents], lineage);
155147
// console.log('lineage post recursive call', lineage)
156148
}

0 commit comments

Comments
 (0)