Skip to content

Commit

Permalink
Merge pull request #6 from quanru/fix/table-render
Browse files Browse the repository at this point in the history
Fix table render in BulletListByTag view
  • Loading branch information
quanru authored Jul 8, 2023
2 parents 8ca9a8e + b77b853 commit 0e879ae
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "periodic-para",
"name": "Periodic PARA",
"version": "1.1.1",
"version": "1.1.2",
"minAppVersion": "0.15.0",
"description": "This is a plugin to assist in practicing the PARA system with periodic notes.",
"author": "YiBing Lin <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "periodic-para",
"version": "1.1.1",
"version": "1.1.2",
"description": "This is a plugin for [LifeOS](https://sspai.com/post/80802)",
"main": "main.js",
"scripts": {
Expand Down
13 changes: 9 additions & 4 deletions src/periodic/Bullet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class Bullet {
const filepath = ctx.sourcePath;
const {
frontmatter: { tags },
} = this.dataview.page(filepath)?.file || {};
} = this.dataview.page(filepath)?.file || { frontmatter: {} };
const component = new Component();
const containerEl = el.createEl('div');

Expand All @@ -52,17 +52,22 @@ export class Bullet {
}`;
})
.join(' ');
const markdown = await this.dataview.tryQueryMarkdown(`
const markdown = await this.dataview.tryQueryMarkdown(
`
TABLE WITHOUT ID rows.L.text AS "Text", rows.file.link AS "File"
FROM (${from}) AND -"Templates"
FLATTEN file.lists AS L
WHERE ${where} AND !L.task AND file.path != "${filepath}"
GROUP BY file.link
SORT rows.file.link DESC
`);
`
);
const formatedMarkdown = markdown
.replaceAll('\\\\', '\\')
.replaceAll('\n<', '<');

return MarkdownRenderer.renderMarkdown(
markdown.replaceAll('\\|', '|'),
formatedMarkdown,
el.createEl('div'),
ctx.sourcePath,
component
Expand Down
2 changes: 1 addition & 1 deletion src/periodic/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class Task {
const filepath = ctx.sourcePath;
const {
frontmatter: { tags },
} = this.dataview.page(filepath)?.file || {};
} = this.dataview.page(filepath)?.file || { frontmatter: {} };
const component = new Component();
const containerEl = el.createEl('div');

Expand Down

0 comments on commit 0e879ae

Please sign in to comment.