forked from Mirrors/apostrophe
Set PWD to the open document path
Convert local paths to absolute on exporting preview and htmlui^2^2
parent
0647b41340
commit
d7df0c68f7
|
@ -6,7 +6,7 @@ function fix_path (path)
|
||||||
if string.starts(path, "/") then
|
if string.starts(path, "/") then
|
||||||
return path
|
return path
|
||||||
else
|
else
|
||||||
return (os.getenv('PANDOC_PREFIX') or '') .. path
|
return (pandoc.system.get_working_directory() or '') .. "/" .. path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,7 @@ class Export:
|
||||||
|
|
||||||
if export_type == "html":
|
if export_type == "html":
|
||||||
to = "html5"
|
to = "html5"
|
||||||
args.append("--standalone")
|
args.append("--self-contained")
|
||||||
args.append("--css=%s" % Theme.get_current().web_css_path)
|
args.append("--css=%s" % Theme.get_current().web_css_path)
|
||||||
args.append("--mathjax")
|
args.append("--mathjax")
|
||||||
args.append("--lua-filter=%s" % helpers.get_script_path('relative_to_absolute.lua'))
|
args.append("--lua-filter=%s" % helpers.get_script_path('relative_to_absolute.lua'))
|
||||||
|
|
|
@ -442,7 +442,6 @@ class MainWindow(StyledWindow):
|
||||||
return
|
return
|
||||||
|
|
||||||
if filename:
|
if filename:
|
||||||
print(urllib.parse.unquote(filename))
|
|
||||||
if filename.startswith('file://'):
|
if filename.startswith('file://'):
|
||||||
filename = urllib.parse.unquote(filename)[7:]
|
filename = urllib.parse.unquote(filename)[7:]
|
||||||
self.text_view.clear()
|
self.text_view.clear()
|
||||||
|
@ -520,7 +519,6 @@ class MainWindow(StyledWindow):
|
||||||
def open_recent(self, _widget, data=None):
|
def open_recent(self, _widget, data=None):
|
||||||
"""open the given recent document
|
"""open the given recent document
|
||||||
"""
|
"""
|
||||||
print("open")
|
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
if self.check_change() == Gtk.ResponseType.CANCEL:
|
if self.check_change() == Gtk.ResponseType.CANCEL:
|
||||||
|
@ -631,6 +629,7 @@ class MainWindow(StyledWindow):
|
||||||
if filename:
|
if filename:
|
||||||
self.filename = filename
|
self.filename = filename
|
||||||
base_path = os.path.dirname(self.filename)
|
base_path = os.path.dirname(self.filename)
|
||||||
|
os.chdir(base_path)
|
||||||
else:
|
else:
|
||||||
self.filename = None
|
self.filename = None
|
||||||
base_path = "/"
|
base_path = "/"
|
||||||
|
|
|
@ -57,7 +57,6 @@ class DragDropHandler:
|
||||||
text_buffer.delete(cursor_iter_l, cursor_iter_r)
|
text_buffer.delete(cursor_iter_l, cursor_iter_r)
|
||||||
|
|
||||||
if text.startswith(("http://", "https://", "www.")):
|
if text.startswith(("http://", "https://", "www.")):
|
||||||
print("web")
|
|
||||||
text = "[{}]({})".format(_("web page"), text)
|
text = "[{}]({})".format(_("web page"), text)
|
||||||
limit_left = 1
|
limit_left = 1
|
||||||
limit_right = len(_("web page"))
|
limit_right = len(_("web page"))
|
||||||
|
|
Loading…
Reference in New Issue