Skip to content

[bug] dc.Table returns poor HTML when frontmatter value is empty #141

@Apina

Description

@Apina

When pulling in frontmatter data, if the value is empty it produces a td > span > ul > li > ::marker

Correct result would be td > span (empty) or td (empty)

Adding literally anything other than a space to the key:value pairs value will make the table behave properly.

This marker basically messes up the styling by adding in a bullet point with large padding on the ul (datacore styling).

Tested on a new vault with only Datacore enabled and the issue persists.

Image

Code used is just a modified example

datacorejsx  
// A list of columns to show in the table.  
const COLUMNS = [  
{ id: "Name", value: page => page.$link },  
{ id: "Description", value: page => page.value('description') },  
];  
  
return function View() {  
// Selecting `#game` pages, for example.  
const pages = dc.useQuery('@page and path("NPCs") and location.contains("Palebank")');  
  
// Uses the built in table component for showing objects in a table!  
return <dc.Table columns={COLUMNS} rows={pages} />;  
}  
Frontmatter on "problem" note
---
type: npc
description:
publishable: true
tags: []
world: Oerth
location: Palebank
created_date: <% tp.date.now("YYYY-MM-DD") %>
---

Edit: not sure if this is odd behaviour or not but also noticed that if you use single punctuation such as dash, plus sign, equals, etc. it either removes the item completely, has the same issue as above, or just leaves a blank value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions