obsidian-sanctum icon indicating copy to clipboard operation
obsidian-sanctum copied to clipboard

Bug: Compatibility with image captions

Open 0xlevel opened this issue 1 year ago • 0 comments

Bug Description

If the part of an image tag after the pipe contains keywords of the side note syntax (e.g. left, right or center) the layout will be interpreted as such. The image will be moved left outside the page (neg. margin).

I use the plugin bicarlsen/obsidian_image_caption: Add captions to images in Obsidian., which allows to add captions. This is a special case and this syntax is not following the standard Obsidian format (hence, not really a "bug", sorry). But it is also quite common to utilize the post-pipe text in links and it might be an easy fix.

To Reproduce

Catches the "left" keyword as side note syntax, adds a neg. margin and moves the image left, outside the page:

Engelbart|"A few nanoseconds of satisfaction are left, before…"

A quick and dirty fix, is to push the margin back:

Engelbart|left ----- "A few nanoseconds of satisfaction are left, before…"

Expected behavior

The text after the pipe (or any exclusion by a custom rule/character) should not be interpreted as side note syntax.

Relevant Screenshot(s)

sorry, not necessary, but placed a page with the sanctum theme, the css clearly shows th effect for margin-left:

.markdown-rendered img[alt*=left], .workspace-leaf-content img[alt*=left] {
    margin-left: calc(-50% + var(--move));
}

Obsidian Version

0.15.9

Installer Version

v1.0.3

Font Size

14

Which editor are you using?

  • [X] New Editor
  • [ ] Legacy Editor

In which mode(s) does the problem occur? (if applicable)

  • [X] Reading View (Preview)
  • [ ] Editing View - Source Mode
  • [ ] Editing View - Live Preview

Which operating system?

  • [ ] Windows
  • [X] macOS
  • [ ] Linux
  • [ ] Android
  • [ ] iOS

Checklist

  • [X] I updated to the latest version of the theme (Settings → Appearance → Themes - Manage → Update).
  • [X] I made sure that the issue is related to this theme by checking that the problem does not occur with the default theme.
  • [X] If the bug occured after updating the theme, I read the last couple Releases to make sure the bug is not an intentional change.

Additional Context

I really like the theme. Thank you!

0xlevel avatar Nov 28 '22 18:11 0xlevel