Skip to content

Commit 0c3ce90

Browse files
authored
Merge pull request #28 from DavidCEllis/fix-linux-local-images
Linux requires an explicit file:/// URI in order for local links to work
2 parents 13184a5 + 1735c7d commit 0c3ce90

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/splitguides/ui/main_window.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,9 @@ def update_notes(self, idx, refresh=False):
385385
notes=self.notes.render_splits(start, end),
386386
)
387387

388-
self.ui.notes.setHtml(html, baseUrl=self.notefile)
388+
note_uri = Path(self.notefile).absolute().as_uri()
389+
390+
self.ui.notes.setHtml(html, baseUrl=note_uri)
389391
self.split_index = idx
390392

391393
def open_settings(self):

tests/test_ui/test_main_window.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,10 @@ def test_update_notes(qtbot, fake_link, idx):
223223
css=main_window.css,
224224
notes="Fake Splits",
225225
)
226-
fake_note_ui.setHtml.assert_called_once_with("Fake HTML", baseUrl="Notes_URL")
226+
227+
note_path = Path("Notes_URL").absolute().as_uri()
228+
229+
fake_note_ui.setHtml.assert_called_once_with("Fake HTML", baseUrl=note_path)
227230

228231
assert main_window.split_index == used_idx
229232

0 commit comments

Comments
 (0)