Comments (1)
Currently, it's possible to render a file-relative image using ![Company logo](./distribution/media/logo.png)
-- that gets parsed right here:
Lines 55 to 57 in 7c1f2ee
I'd be happy to implement rendering your example as well. In fact, I think I considered it, but I wasn't sure if it was a file path or a domain name. Now that I'm testing, though, it seems github only parses URLs if they start with http://
or https://
, so maybe it'd be quite simple to get this done by changing the .starts_with?
with a check for not starting with http://
or with https://
. Or maybe even .\w+://
for stuff like ftp://
or file://
.
Ideally it would look for the file starting at the root of the current Git repo,
According to this doc, I think repo-root-relative files start with /
? https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#images
This would also be fine to implement, and pretty useful -- the code could check for a .git
file or directory upwards, and if it exists, check if that file exists. But maybe this could be done separately.
I can try opening a PR for this if it's not too hard to implement.
I think it should be relatively easy to use the regex crate to check that the "url" in that code doesn't start with a protocol and ://
. There's also a test that would need to be tweaked and maybe extended:
quickmd/tests/test_markdown.rs
Lines 32 to 50 in 7c1f2ee
If you don't have the time/energy or Rust experience, I can take care of it as well -- let me know 👍.
from quickmd.
Related Issues (13)
- Exploratory: Try porting to web-view
- Provide Binary releases HOT 3
- File watching is broken with NeoVim HOT 3
- Rendering is broken with `glib2-2.72` HOT 14
- Spawn an external editor with a keypress HOT 1
- Autolink URLs HOT 2
- Handle remote links HOT 1
- Customizable keybindings HOT 7
- Scrolling with j/k, maybe others HOT 1
- Themes and/or "dark mode" HOT 1
- Embed highlight.js files
- A help popup on F1, maybe others HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quickmd.