Remark: Spaces in image URLs not support (GFM)

Created on 6 Nov 2020  路  4Comments  路  Source: remarkjs/remark

Subject of the issue

parser flaw.

Your environment

System:
OS: macOS 11.0.1
CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
Memory: 1.29 GB / 32.00 GB
Shell: 3.1.2 - /usr/local/bin/fish
Binaries:
Node: 15.1.0 - /usr/local/bin/node
Yarn: 1.22.5 - ~/.yarn/bin/yarn
npm: 7.0.7 - /usr/local/bin/npm

with remark 13.

Steps to reproduce

When the image path has space, the node detect as text node

![image-20201029103101438](/Users/daniel/Library/Application Support/typora-user-images/image-20201029103101438.png)

Expected behavior

Image node

Actual behavior

text node

馃檵 typquestion

All 4 comments

image-20201029103101438

As @yunwuxin notes, this behavior conforms to the commonmark and gfm specifications.
https://spec.commonmark.org/dingus/?text=!%5Bimage-20201029103101438%5D(%2FUsers%2Fdaniel%2FLibrary%2FApplication%20Support%2Ftypora-user-images%2Fimage-20201029103101438.png)%0A%0A%0A!%5Bimage-20201029103101438%5D(%2FUsers%2Fdaniel%2FLibrary%2FApplication%2520Support%2Ftypora-user-images%2Fimage-20201029103101438.png)

If you want to have a space, it needs to be url encoded

![image-20201029103101438](/Users/daniel/Library/Application%20Support/typora-user-images/image-20201029103101438.png)

@ChristianMurphy Thanks for the explaination. It's clear to me now.

You can also use angle/pointy brackets btw: [text](<lots of things!>)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CxRes picture CxRes  路  4Comments

maximbaz picture maximbaz  路  7Comments

ikatyang picture ikatyang  路  7Comments

soroushm picture soroushm  路  6Comments

wooorm picture wooorm  路  4Comments