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

[6.x, 7.x] A Markdown link prevents showing URLs with the unsafe protocol #9400

Open
gucchy55 opened this issue Nov 13, 2024 · 3 comments
Open

Comments

@gucchy55
Copy link

Environment

Host

item version
OS Docker image
GROWI 6.3.5
node.js 18.20.3
npm 10.7.0
Using Docker yes
Using growi-docker-compose yes

(Accessing https://{GROWI_HOST}/admin helps you to fill in above versions)

Client

item version
OS macOS Sonoma / Windows 10/11
browser Google Chrome 130.0.6723.117

How to reproduce? (再現手順)

  1. Put a Markdown link with an "lw" protocol such as: [Markdown link](lw://path/to/dir)

What happens? (症状)

The rendered html does not contain the href attribute value: <a href>"Markdown link"</a>

What is the expected result? (期待される動作)

The rendered html contains the href attribute value: <a href="lw://path/to/dir">Markdown link</a>

Note

  • I am using an "lw" link to open the file path with a filer application.
  • The link worked with Growi: 5.1.6 as expected.
@yuki-takei
Copy link
Member

It seems to be prevented by remark-js/react-markdown.
ref: safeProtocol

@yuki-takei yuki-takei changed the title [6.3.5] A Markdown link does not work for URLs with a specific protocol. [6.x, 7.x] A Markdown link does not work for URLs with a specific protocol. Nov 13, 2024
@yuki-takei yuki-takei changed the title [6.x, 7.x] A Markdown link does not work for URLs with a specific protocol. [6.x, 7.x] A Markdown link prevents showing URLs with the unsafe protocol Nov 13, 2024
@gucchy55
Copy link
Author

Is it difficult to enable customization for unsafe protocols for security reasons or others?
Growi 6.3.5 looks using react-markdown 8.0.7 in which the protocols look defined at:
https://github.com/remarkjs/react-markdown/blob/4a6065ba509f1232b94d3b79b6d426626aede6d2/lib/uri-transformer.js#L1

@yuki-takei
Copy link
Member

yuki-takei commented Nov 18, 2024

It might be possible to customize it by setting the urlTransform option, but the team does not prioritize this.

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

No branches or pull requests

2 participants