eebmagic / post-medium-draft

Obsidian plugin to post a note to your medium account as a draft.
MIT License
6 stars 2 forks source link

Issue with image and equations #2

Open Nempickaxe opened 1 day ago

Nempickaxe commented 1 day ago

How to publish images and equations, this seems to be being written with $$ enclosement for equations... and images are coming as ![]... not the actual image

eebmagic commented 21 hours ago

Images

This extension just posts the raw content of your note to the Medium API endpoint (which has an option for markdown input). There is no additional processing on the content of your note.

Images will need to be embedded in your note with a url, not a file-path.

I tried embedding images as base64 in an html tag, but that didn't seem to be handled by Medium correctly.

In the past I've just added "insert image here" notes, and then drag-and-drop into the Medium draft editor.

Equations

I believe that Obsidian flavored markdown supports equations as an extension on top of a markdown standard, which is not done in the .md standard that the Medium API supports.

I looked to see if it's possible to do a workaround with HTML elements, but I think that would require importing scripts, which is not supported by Medium for security reasons.

From looking at the comments under this medium article it looks like the workarounds are

  1. Convert equations to images and import
  2. Convert to unicode characters

But there are some good looking Chrome extensions for that in those comments.