node-red / flow-library

Node-RED Flow Library
Apache License 2.0
70 stars 44 forks source link

Relative GitHub links, loading up raw content #41

Closed marcus-j-davies closed 3 years ago

marcus-j-davies commented 3 years ago

Hey,

Long time user of node-red here. Not sure if this is the correct place to log this issue.

But. My Github readme uses relative links. to other markdown files (./moreinfo.md). See Here.

Clicking these links in npmjs, correctly loads the processed markdown file. But the flows web page loads the raw version, and you end up getting, quite liberally the raw file.

The link goes to: https://raw.githubusercontent.com/marcus-j-davies/node-red-contrib-zwave-js/master/managed.md Instead of: https://github.com/zwave-js/node-red-contrib-zwave-js/blob/main/managed.md

Hope this makes sense,

Edit: Maybe redirect to the processed file, if the link resolves to a markdown document?

marcus-j-davies commented 3 years ago

Anyone?

knolleary commented 3 years ago

Thanks for reporting. Will investigate when I get a chance. If anyone else wants to jump in, they're welcome.

marcus-j-davies commented 3 years ago

Thanks for the acknowledgement, was getting worried for a second.

marcus-j-davies commented 3 years ago

For reference, here is the markdown (newer releases of my repo include ./ as part of the link) Not sure if that will make a difference though.

[Managed](managed.md)  
If you're wanting to get up and running quickly, or not familiar with Z-Wave JS, then this is for you.

[Unmanaged](unmanaged.md)   
If you're familiar with Z-Wave JS, or a more hardened user, to various z-wave stack implementations, then this may be more useful.  
knolleary commented 3 years ago

All fixed. Any link to a local .md file is rewritten to the file's github page.

The only catch is we don't know for sure what branch the file is on. We currently assume master, but given GitHub now uses main as the default we may need to revisit this. Thankfully GH redirects to the default branch if you specify a branch that doesn't exist.