I’m sorry. On second thought, this plugin works for me, but one must switch to View Mode (instead of Edit Mode).
The other trick also works, but again, only on View Mode:
<div src=“./media/image261.jpg” class=“internal-embed”>
I’m sorry. On second thought, this plugin works for me, but one must switch to View Mode (instead of Edit Mode).
The other trick also works, but again, only on View Mode:
<div src=“./media/image261.jpg” class=“internal-embed”>
The <img src="./rel/img.png" width="..." />
format is the only one which works with GitHub repos with Retina / HiDPI images. Nothing else is supported.
Until this is implemented no one can use Obsidian to edit Markdown files which are primarily displayed on GitHub, like open-source project documentations.
I imported notes from Joplin and had the same problem with the balise. I’ve done a simple script that do the job of replacing to be compliant with obsidian format. I’ve updated all my notes and it’s ok.
+1.
In the meantime, here’s a Templater template that creates an HTML structure for displaying a local image side-by-side with text in Obsidian.
<%*
const text = tp.file.selection() || "Text";
const position = await tp.system.suggester(
["Left", "Right"],
["left", "right"]
);
const addCaption = await tp.system.suggester(
["Caption", "No caption"],
[true, false]
);
const imageBlock = ` <figure style="width: 50%; text-align: center;">
<div src="IMAGEPATH" class="internal-embed" style="max-width: 100%; width: 100%; margin-bottom: 10px;"></div>${addCaption ? `
<figcaption style="color: var(--text-faint); font-size: 0.85em;">Caption</figcaption>` : ''}
</figure>`;
const textBlock = ` <p style="width: 50%; padding-left: 10px;">${text}</p>`;
tR = `<div style="display: flex; align-items: center;">
${position === "left" ? imageBlock + textBlock : `<p style="width: 50%; padding-right: 10px;">${text}</p>${imageBlock}`}
</div>`;
-%>
It prompts for:
Features:
Usage: Replace “IMAGEPATH” with your local image path.
Please let me know if there’s a more elegant solution to this. I prefer not to rely on third-party tools for this though. (Templater merely inserts the code.)