-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Embedding local images doesn't work #136
Comments
thanks @artisticat1 |
I am working on this. I'm trying to see what's broken... when the embed string arrives to renderMarkdown does not continue the function, so the handleEmbeds service does not do its magic export async function renderMarkdown(
cell: Cell,
markdownString: string,
domElement: HTMLDivElement,
depth: number
) {
try {
const view: DatabaseView = (cell as any).tableData.view;
const column = cell.column as unknown as DatabaseColumn;
const { media_height, media_width, enable_media_view } = column.config;
if (enable_media_view && isValidHttpUrl(markdownString)) {
markdownString = `![embedded link|${media_height}x${media_width}](${markdownString})`;
}
console.log("rendering markdown", markdownString);
domElement.empty();
const dom = domElement.createDiv();
dom.addClasses(["markdown-preview-view", c("markdown-preview-view")]);
dom.createDiv(c("embed-link-wrapper"), (wrapper) => {
wrapper.createEl(
"a",
{
href: domElement.getAttr("src") || view.file.basename,
cls: `internal-link ${c("embed-link")}`,
},
(link) => {
link.setAttr("aria-label", view.file.basename);
}
);
});
await MarkdownRenderer.renderMarkdown(
markdownString,
dom.createDiv(),
view.file.path,
view
);
// STOPS HERE BY SOME MISTERIOUS REASON
domElement.addClass("is-loaded");
if (depth > 0) {
await handleEmbeds(dom, view, --depth);
}
} catch (e) {
LOGGER.error(e);
}
} |
Okay.... Looks like |
Screen.Recording.2022-06-17.at.20.48.55.mov |
Great! I tested it and it works, but when I close and reopen the database, the image stops showing up. |
just work with inline fields yet |
Describe the bug
Embedding local images in a text column doesn't work
To Reproduce
img.png
)![[img.png]]
, then exit the cell. No image is shown.Expected behavior
The image is shown in the text column, and persists after closing/reopening the database
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: