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图片url带空格不能显示 #3879

Open
iyezhou opened this issue Nov 21, 2019 · 7 comments
Open

markdown图片url带空格不能显示 #3879

iyezhou opened this issue Nov 21, 2019 · 7 comments

Comments

@iyezhou
Copy link

@iyezhou iyezhou commented Nov 21, 2019

老版本可以正常显示,4.0不能显示

@curbengh

This comment has been minimized.

Copy link
Contributor

@curbengh curbengh commented Nov 27, 2019

Can you show an example link? Can you try replacing the space with %20?

-![caption](http://example.com/foo bar)
+![caption](http://example.com/foo%20bar)

Are you using hexo-renderer-marked?

@iyezhou

This comment has been minimized.

Copy link
Author

@iyezhou iyezhou commented Nov 27, 2019

I replace space with %20 can solve this problem, but I must change all md files, Is there any solution that need not modify source md file?
example: http://www.appblog.cn/2019/09/15/Shadowsocks%20+%20Privoxy%20%E6%90%AD%E5%BB%BA%20http%20%E4%BB%A3%E7%90%86%E6%9C%8D%E5%8A%A1/

@iyezhou

This comment has been minimized.

Copy link
Author

@iyezhou iyezhou commented Nov 27, 2019

my package.json

"dependencies": {
    "hexo": "^4.0.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-index": "^1.0.0",
    "hexo-generator-tag": "^1.0.0",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-stylus": "^1.1.0",
    "hexo-renderer-marked": "^2.0.0",
    "hexo-server": "^1.0.0"
}
@curbengh

This comment has been minimized.

Copy link
Contributor

@curbengh curbengh commented Nov 27, 2019

hexo 4 (specifically hexo-renderer-marked) uses newer version of marked and I believe marked may have dropped supporting space in link. markdown-it (used in hexo-renderer-markdown-it) also doesn't support.

I don't think the markdown standard supports space in link, not even github supports it.

Try writing the following in comment and preview it,

[test](http://www.appblog.cn/2019/09/15/Shadowsocks +%20Privoxy%20%E6%90%AD%E5%BB%BA%20http%20%E4%BB%A3%E7%90%86%E6%9C%8D%E5%8A%A1/)
@iyezhou

This comment has been minimized.

Copy link
Author

@iyezhou iyezhou commented Nov 27, 2019

But my previous version really supports spaces. and my previous source md files have no problem.

my previous version package.json

"dependencies": {
    "hexo": "^3.2.0",
    "hexo-generator-archive": "^0.1.4",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-index": "^0.2.0",
    "hexo-generator-tag": "^0.2.0",
    "hexo-renderer-ejs": "^0.3.0",
    "hexo-renderer-stylus": "^0.3.1",
    "hexo-renderer-marked": "^0.3.0",
    "hexo-server": "^0.2.0"
  }
@curbengh

This comment has been minimized.

Copy link
Contributor

@curbengh curbengh commented Nov 27, 2019

Newer marked may have dropped support for space in link, in order to support title="" attribute in <img> element.

![Alt](/path/to/img.jpg "image title")

becomes

<img src="/path/to/img.jpg" alt="Alt" title="image title">
@iyezhou

This comment has been minimized.

Copy link
Author

@iyezhou iyezhou commented Nov 27, 2019

I see, thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.