Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/remark-wiki-link/src/lib/fromMarkdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ function fromMarkdown(opts: FromMarkdownOptions = {}) {
width: '100%',
src: `${hrefTemplate(link)}#toolbar=0`,
};
} else if (format === 'csv') {
// CSV support
wikiLink.data.hName = 'FlatUiTable';
wikiLink.data.hProperties = {
data: { url: hrefTemplate(link) },
};
} else {
const hasDimensions = alias && /^\d+(x\d+)?$/.test(alias);
// Take the target as alt text except if alt name was provided [[target|alt text]]
Expand Down
5 changes: 5 additions & 0 deletions packages/remark-wiki-link/src/lib/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ function html(opts: HtmlOptions = {}) {
link
)}#toolbar=0" class="${classNames}" />`
);
} else if (format === 'csv') {
// CSV support
this.tag(
`<FlatUiTable data={{ url: "${hrefTemplate(link)}" }} />`
);
} else {
const hasDimensions = alias && /^\d+(x\d+)?$/.test(alias);
// Take the target as alt text except if alt name was provided [[target|alt text]]
Expand Down
1 change: 1 addition & 0 deletions packages/remark-wiki-link/src/lib/isSupportedFileFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const supportedFileFormats = [
"avif",
"ico",
"pdf",
"csv",
];

export const isSupportedFileFormat = (filePath: string): [boolean, string] => {
Expand Down