[Markdown] How to support relative image links when exporting
Posted: Tue Nov 28, 2023 11:49 am
One problem on "auto-exporting" markdown comments to .html with images, is there any possibility to allow relative links to images/files?
The exported report.html have links to images hardcoded to the real path folder, so they dont work is you open the .html on web server urls ( For example: http://192.168.1.102/todolist/projectname/todolist.html )
The report.html show the link to the images like this:
```
<img src="file:///T:/projectname/test.jpg" alt="img">
```
I have a shared folder on Linux with project folders + multiples taskslists per project on a intranet with SAMBA and a web server for the visualization in realtime of the .html reports (great combo for small bussiness with multiple people working on projects).
This img urls links will be compatible with HTML on webservers and local opened files "reports.html":
```
<img src="./test.jpg" alt="img">
<img src="test.jpg" alt="img">
```
My testing results on SAMBA + APACHE2 ( Mounted as virtual drive T:\ to a samba intranet server \\192.168.1.102\todolist\ )
----
### MARKDOWN2HTML - Test with images forcing the HTML code IMG on the markdown
- ERROR on markdown previsualization
- OK opening the .html on a web server
- OK opening the .html locally
<img src="./images/test.jpg" alt="test">
<img src="./test.jpg" alt="test">
<img src="test.jpg" alt="test">
----
### MARKDOWN2HTML - Test with images in markdown format
- OK on markdown previsualization
- ERROR opening the .html on a web server
- OK opening the .html locally





The exported report.html have links to images hardcoded to the real path folder, so they dont work is you open the .html on web server urls ( For example: http://192.168.1.102/todolist/projectname/todolist.html )
The report.html show the link to the images like this:
```
<img src="file:///T:/projectname/test.jpg" alt="img">
```
I have a shared folder on Linux with project folders + multiples taskslists per project on a intranet with SAMBA and a web server for the visualization in realtime of the .html reports (great combo for small bussiness with multiple people working on projects).
This img urls links will be compatible with HTML on webservers and local opened files "reports.html":
```
<img src="./test.jpg" alt="img">
<img src="test.jpg" alt="img">
```
My testing results on SAMBA + APACHE2 ( Mounted as virtual drive T:\ to a samba intranet server \\192.168.1.102\todolist\ )
----
### MARKDOWN2HTML - Test with images forcing the HTML code IMG on the markdown
- ERROR on markdown previsualization
- OK opening the .html on a web server
- OK opening the .html locally
<img src="./images/test.jpg" alt="test">
<img src="./test.jpg" alt="test">
<img src="test.jpg" alt="test">
----
### MARKDOWN2HTML - Test with images in markdown format
- OK on markdown previsualization
- ERROR opening the .html on a web server
- OK opening the .html locally




