I am trying to use qlmanage, a terminal command to perform Quick Look actions, to open a html file and jump to a specific location in the file (anchor). In the browser, I would just use file:///[LOCATION]/test.html#jump but that does not work with qlmanage. Below is an example that works with qlmanage and some attempts to jump to the anchor, which are not working.
Note that Quick Look itself can jump to anchors in html files. When I open links from emails with anchors, quick look jumps to the correct location. Hovering over the link in an email shows this:
'x-apple-ql-file:///[LOCATION]/test.html?/[LOCATION]/#jump
Thanks!
Works
Doesn't work
Example HTML File
Note that Quick Look itself can jump to anchors in html files. When I open links from emails with anchors, quick look jumps to the correct location. Hovering over the link in an email shows this:
'x-apple-ql-file:///[LOCATION]/test.html?/[LOCATION]/#jump
Thanks!
Works
Code:
/usr/bin/qlmanage -p '~/Desktop/test.html'
Doesn't work
Code:
/usr/bin/qlmanage -p '~/Desktop/test.html#jump'
/usr/bin/qlmanage -p 'file:///[LOCATION]/test.html#jump'
Example HTML File
Code:
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="chrome=1"></head>
<body>
<h1>Heading</h1>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<p id="jump">
jump here
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<p>
</body>