Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown strips escape sequences from image urls #1622

Closed
j000 opened this issue Aug 24, 2017 · 7 comments
Closed

Markdown strips escape sequences from image urls #1622

j000 opened this issue Aug 24, 2017 · 7 comments

Comments

@j000
Copy link
Contributor

j000 commented Aug 24, 2017

Escape sequences should be left alone. The same thing does not happen to links.

![Failed](http://example.com/?q=a%20b+c%2bd)

will render as

<img src="http://example.com/?q=a b c+d" alt="Failed" />

The same sequence works fine on http://parsedown.org/demo:

<img src="http://example.com/?q=a%20b+c%2bd" alt="Failed" />
@rhukster rhukster added the bug label Aug 25, 2017
@rhukster
Copy link
Member

I'll have a look at this tomorrow. Thanks.

@rhukster
Copy link
Member

Should be fixed, please try develop branch

@dirkjf
Copy link
Contributor

dirkjf commented May 18, 2023

This problem appears to be back. @rhukster, can this be reopened?

@rhukster
Copy link
Member

I can't recreate it.. tried your example:

![Failed](http://example.com/?q=a%20b+c%2bd)

and it renders as:

<img src="http://example.com/?q=a%20b+c+d" alt="Failed">

With latest Grav 1.7.41.1

@rhukster
Copy link
Member

rhukster commented May 18, 2023

well it changed the %2b to the +, is that what you mean?

@dirkjf
Copy link
Contributor

dirkjf commented May 18, 2023

I should have specified, there is an issue with the path. So if you try: ![image](image%20wtih%20spaces.jpeg), it will render: <img src="/typography/image wtih spaces.jpeg" alt="image"> instead of <img src="/typography/image%20wtih%20spaces.jpeg" alt="image">. I've created a PR that should fix this.

@rhukster
Copy link
Member

I did also try a filename with spaces in it like the example you had. And it did not convert those spaces to %20 and was broken when rendering. However, I think it's always been this way, at least I went back version to a couple of years ago and it didn't work there either.

I will review your PR, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants