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

Support 'file' URI schema #755

Closed
4 tasks done
DzmitrySudnik opened this issue Jul 21, 2023 · 4 comments
Closed
4 tasks done

Support 'file' URI schema #755

DzmitrySudnik opened this issue Jul 21, 2023 · 4 comments
Labels
🙅 no/wontfix This is not (enough of) an issue for this project 👎 phase/no Post cannot or will not be acted on

Comments

@DzmitrySudnik
Copy link

Initial checklist

Problem

Hi,

I want to render urls which use file schema, pointing to local file system files, for example:

  • file:///etc/hosts

Since URI supports file schema (RFC: https://datatracker.ietf.org/doc/html/rfc8089) and browsers open such links just fine I think it's reasonable to add support for it to react-markdown.

Thanks

Solution

I think just adding 'file' to the protocol list in https://github.com/remarkjs/react-markdown/blob/8.0.7/lib/uri-transformer.js will do it.

Alternatives

Can't think if anything more simple than adding 'file' to the protocols list.

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Jul 21, 2023
@wooorm
Copy link
Member

wooorm commented Jul 21, 2023

You can pass your own uri transformer?

@ChristianMurphy ChristianMurphy added the 🙉 open/needs-info This needs some more info label Aug 8, 2023
@github-actions

This comment has been minimized.

@wooorm
Copy link
Member

wooorm commented Sep 14, 2023

Passing your own uriTransformer is a viable alternative. It’s in my opinion also better because it does not change the behavior for every user of react-markdown ever.

@wooorm wooorm closed this as not planned Won't fix, can't repro, duplicate, stale Sep 14, 2023
@wooorm wooorm added the 🙅 no/wontfix This is not (enough of) an issue for this project label Sep 14, 2023
@github-actions

This comment has been minimized.

@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually 🙉 open/needs-info This needs some more info labels Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙅 no/wontfix This is not (enough of) an issue for this project 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

3 participants