CSV embed using wiki-link transclusion format#1287
CSV embed using wiki-link transclusion format#1287gradedSystem wants to merge 3 commits intodatopian:mainfrom
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 6 Skipped Deployments
|
|
@gradedSystem is attempting to deploy a commit to the Datopian Team on Vercel. A member of the Team first needs to authorize it. |
|
@olayway added test cases |
olayway
left a comment
There was a problem hiding this comment.
Some changes are needed, especially to html lib and it's test suite.
Also, please update the README, including instructions on any requirements for using this csv embeds. I suggest trying to use it e.g. in our Flowershow template and document any steps you had to take to make it work.
|
|
||
| test("should return [true, <extension>] for a path with supported file extension", () => { | ||
| const filePath = "image.csv"; | ||
| expect(isSupportedFileFormat(filePath)).toStrictEqual([false, "csv"]); | ||
| }); |
There was a problem hiding this comment.
This is already covered by the test with the same title above.
| test("should return [true, <extension>] for a path with supported file extension", () => { | |
| const filePath = "image.csv"; | |
| expect(isSupportedFileFormat(filePath)).toStrictEqual([false, "csv"]); | |
| }); |
| expect(serialized).toBe( | ||
| '<p><a href="data.csv" class="internal new" download="data.csv">data.csv</a></p>' | ||
| ); |
There was a problem hiding this comment.
Why is it a regular a tag and not FlatUiTable? Isn't it the aim of this PR?
| ); | ||
| }); | ||
|
|
||
| test("parses a CSV file embed of unsupported file format", () => { |
There was a problem hiding this comment.
| test("parses a CSV file embed of unsupported file format", () => { | |
| test("leaves a CSV file embed of unsupported file format as plain text", () => { |
| htmlExtensions: [html({ permalinks: ["data.csv"] }) as any], // TODO type fix | ||
| }); | ||
| expect(serialized).toBe( | ||
| '<p><a href="data.csv" class="internal" download="data.csv">data.csv</a></p>' |
There was a problem hiding this comment.
Again, why does it include a regular a tag?
| htmlExtensions: [html() as any], // TODO type fix | ||
| }); | ||
| expect(serialized).toBe( | ||
| '<p><a href="data.csv" class="internal new" download="data.csv">My CSV File</a></p>' |
There was a problem hiding this comment.
???
If anything, alias should be used as table title. But I think you can just ignore it for now.
|
Fixed the issues with tests @olayway |
Changelog
Added
![[data.csv]]syntax. CSV files are rendered as tables in markdown.Updated
fromMarkdown.ts: Modified to handle CSV files by rendering them as tables.html.ts: Updated to output CSV files as HTML tables when using the![[data.csv]]syntax.Reference
Issue #1233
cc @olayway