Pico: Embedded images are not displayed

Hey!
I tend to embed images into my Markdown documents. This has been shown to work well in the past as I could easily move my documents between different markdown applications, without having to care about asset files and file/http references.

However this does not work at Pico CMS.

Example

Document: 2020-05-05-brettspiele-kartenspiele-offline.md

PicoCMS

grafik


ruby-kramdown / jekyll

grafik


Content

grafik


Pandoc

grafik


Pico output html

img src / ![img]() was stripped grafik

Version info

I have the PicoCMS that is bundled with NextCloud. CHANGELOG.md in the picocms folder mentions 2.1.4 on top, so guess this is the release version used.

grafik

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15

Most upvoted comments

As said, may be better to recreate the bug report on nextcloud repository? Looks not like there anything Pico developers can do about the issue 😄

Doesn’t make much of a difference whether I answer you here or there 😆

We can’t do anything about this. Pico CMS for Nextcloud is designed to allow arbitrary users to create websites, thus we can’t allow them to use any active content (like JavaScript), otherwise we would create a whole lot of security issues. For this reason we use HTMLPurifier in Pico CMS for Nextcloud, that removes any potentially insecure contents. I’m pretty sure that embedding a WebP image is no security issue at all, but HTMLPurifier simply doesn’t know this rather new format - and thus removes it. As I said, you can head over to the developers of HTMLPurifier and ask them whether they add WebP support - if they do, Pico CMS for Nextcloud will support it, too.

Anyway, from your comments I assume that you don’t actually want arbitrary users of your Nextcloud to create their own websites, you just want to use this for yourself, right? In this case you won’t need Pico CMS for Nextcloud, using the app has no significant advantage for you. The only thing you have to do is to sync Pico’s content and assets dir with your Nextcloud. Just install Pico (as explained here in this repo) and sync both folders with your Nextcloud. You can either use Nextcloud’s files_external app, or, as explained by Maya, symlink the folders. This solves all your issues, embedding WebP images will work just fine then. Just give it a try 👍