obsidian-dataview
obsidian-dataview copied to clipboard
dv.el("hr") should not have children
trafficstars
What happened?
dv.el("hr") ouputs:
<hr>
<span>-</span>
</hr>
This can be fixed by dv.el("hr", ""). However, void elements like hr shouldn't have child elements.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr
DQL
No response
JS
No response
Dataview Version
0.5.47
Obsidian Version
1.0.3
OS
Windows
dv.el is not a very good abstraction generally; I am currently considering replacing it with react-hyperscript, which offers shorthand for making virtual react doms for rendering.
Creating with dv.el is going to add a span which should not exist
It would be nice to pass "null" as second argument to omit the . E.g.
const table = dv.el("table");
const thead = dv.el("thead", null, {container: table})
const trh = dv.el("tr", null, {container:thead})
dv.el("th", "test1", {container:trh})
dv.el("th", "test2", {container:trh})
dv.el("th", "test3", {container:trh})
const tbody = dv.el("tbody", null, {container:table})
const trb = dv.el("tr", null, {container: tbody})
dv.el("td", "1", {container:trb})
dv.el("td", "1", {container:trb})
dv.el("td", "1", {container:trb})