getgrav / getgrav/grav-plugin-admin
Media embed in markdown fails when image filename has ":" character
- Dominant language
- PHP
- Stars
- 377
- Forks
- 225
- Avg merge
- 11h 51m
- Merged PRs (30d)
- 4
Description
Adding images to a grav article hits some kind of an error in the media processing or embedding when the media filename contains colon characters.
For example, I have the following screenshot images attached, with the latter being a copy of the last image but with the filename changed to remove colons:

Using the add image button, I get the following markdown generated, respectively:
````markdown




````
However, when saved, this is the rendered HTML output:
````html
````
As you can see, there's some step, that appears to be distinct from the markdown processing, that is supposed to rewrite the `img src` attribute, that appears to fail when there's a colon character. Possibly based on the latter having %20 injected rather than space, this is expected behaviour, and it's the editor that should be adding %3A for colon instead.
But when I tried manually changing the markdown image reference to have %3A instead of the colons, that didn't fix it. And indeed you can see the parser actually reversed the URL encoding for the `src` attribute.
````markdown

````
````html
````
Thanks!
Contributor guide
Research direction
Start with the admin add-image button and follow the media-processing and Markdown-rendering entry points described in the report. Reproduce the issue with image filenames containing colons, compare the generated Markdown with the rendered HTML, and consider the issue done when those filenames render with the correct image source.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- markdown, php
- Domain
- content
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100