diff --git a/slack_backup/reporters.py b/slack_backup/reporters.py
index bc67009..e2a0ecb 100644
--- a/slack_backup/reporters.py
+++ b/slack_backup/reporters.py
@@ -8,6 +8,7 @@ import os
import errno
import html.parser
import logging
+import pathlib
import re
from slack_backup import objects as o
@@ -227,8 +228,9 @@ class TextReporter(Reporter):
else:
fpath = 'does_not_exists'
- return {'msg': self.url_pat.sub('(file://' + fpath + ') ' +
- msg.file.title, msg.text),
+ return {'msg': self.url_pat.sub('(' +
+ pathlib.PurePath(fpath).as_uri() +
+ ') ' + msg.file.title, msg.text),
'nick': self._get_symbol('file')}
def _msg(self, msg):
@@ -383,11 +385,11 @@ class StaticHtmlReporter(Reporter):
_, ext = os.path.splitext(fpath)
if ext.lower() in ('.png', '.jpg', '.jpeg', '.gif'):
- url = ('
')
+ url = ('
')
else:
- url = ('' + msg.file.title + '')
+ url = ('' + msg.file.title + '')
return {'msg': self.url_pat.sub(url, msg.text),
'nick': self._get_symbol('file')}