Skip to content

Commit

Permalink
Merge pull request #55 from joshniemela/format_fix
Browse files Browse the repository at this point in the history
Format fix
  • Loading branch information
joshniemela authored Aug 21, 2024
2 parents 605979e + 7ab2a54 commit 6e67677
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion frontend/src/routes/course/[courseId]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,21 @@
}
}
onMount(() => remove_repeated_br_tags(document));
// If a p tag is immediately descendent of an li tag, we pop the text out of the p tag
function pop_p_tags(dom: Document) {
let lis = dom.getElementsByTagName("li");
for (let i = 0; i < lis.length; i++) {
let p = lis[i].getElementsByTagName("p");
if (p.length > 0) {
lis[i].innerHTML = p[0].innerHTML;
}
}
}
onMount(() => {
remove_repeated_br_tags(document);
pop_p_tags(document);
});
</script>

<svelte:head>
Expand Down

0 comments on commit 6e67677

Please sign in to comment.