BoostIO / BoostNote-Legacy

This repository is outdated and new Boost Note app is available! We've launched a new Boost Note app which supports real-time collaborative writing. https://github.com/BoostIO/BoostNote-App
Other
17.07k stars 1.47k forks source link

Exported HTML stylesheet does not use relative path #3559

Open cross-hello opened 4 years ago

cross-hello commented 4 years ago

Current behavior

I export md to html. And I found something that will cause the style of HTML invalid if someone change the name of directory from which md export. Here are the operative step:

  1. export e.x.3.md to e.x.3/e.x.3.html
  2. change the folder name of e.x.3 to e.x.3=
  3. open e.x.3.html

Before operation

image

After operation

image

I think the problem is in here. image

It shouldn’t occur for the existence of base href element, which seem use a absoluute path that may cause the file unable moving to another computer. Also it had some responding linked css stylesheet need to change its path. ( In fact, I originally want to upload the photo of linked css elements. But I found I can't-- it is another bug = - =)

It will be ok if delete the base href and change the href above to the new relative paths.

Expected behavior

The output of HTML should not be influenced via the positon.

Steps to reproduce

Environment

Flexo013 commented 4 years ago

To reproduce:

  1. Export HTML to an empty folder called test
  2. Open the HTML
  3. Rename the folder to test2
  4. Observe that the stylesheet no longer works.
cross-hello commented 4 years ago

I would see the problem as a bug. Did someone want to export html just coulde be used in native place? = - =

arcturus140 commented 4 years ago

I never tried this but maybe you can safe the entire page as HTML in your web browser.

huzibizi commented 4 years ago

maybe they could add an option popup when exporting the html so the user could choose between full paths vs relative paths?

or alternatively this could be something that could be chosen in the Preferences section, so the user can choose if they want full paths or relative paths like that. probably be easier to do it that way.