simonw / datasette-render-markdown

Datasette plugin for rendering Markdown
Apache License 2.0
25 stars 0 forks source link

Render image tags #10

Closed niloch closed 3 years ago

niloch commented 3 years ago

Is there a way for this support rendering images so they appear like datasette-render-images but using the markdown syntax ![Alt Text](path/to/image.jpg)? Right now for me, the table view displays the raw html <img alt="" src="/path/to/image.jpg"> without rendering the image itself.

Or is this a case where I'd be better of downloading all those images locally and using datasette-render-images?

simonw commented 3 years ago

I don't see any reason not to support regular markdown images. The reason they don't work now is that Bleach is stripping them out: https://github.com/simonw/datasette-render-markdown/blob/362f7816545598d35e3d4b34e27975ab33b0bc4a/datasette_render_markdown/__init__.py#L44-L74

simonw commented 3 years ago

I'm going to add style="max-width: 100%" to the image tags.

simonw commented 3 years ago

I'm going to re-release this as 2.0 and withdraw that 1.3 release, since this should be considered a breaking change.

simonw commented 3 years ago

I yanked the release on PyPI:

Manage__datasette-render-markdown__releases_·_PyPI
simonw commented 3 years ago

Released as 2.0 here: https://pypi.org/project/datasette-render-markdown/2.0/