Closed havarddj closed 3 months ago
https://github.com/Enter-tainer/typst-preview/blob/c623b767d4b9f4968692fe5c9173d2c6be6f47d6/addons/typst-dom/src/typst-doc.svg.mts#L210 related code. It looks like the regex doesn't match anything for some reason
I will try in firefox and see what translate
looks like
On firefox, the translate
is matrix(1, 0, 0, 1, 0, 0)
. So we fails to extract translate(x, y)
from it.
cc @Myriad-Dreamin any idea?
I was lazy and extract positions from translate
attribute. Perhaps we can do positive and active fix to make it much more robust, that saves data-position
here:
Changing to:
pageElem.setAttribute("transform", translateAttr);
pageElem.setAttribute("data-x", `${x}`);
pageElem.setAttribute("data-y", `${y}`);
And using them without complex parsing.
Great stuff! Thanks a lot
I'm publishing a new version. It will be soon available in vscode marketplace
Great! I've written an emacs package (https://github.com/havarddj/typst-preview.el) for typst-preview so I don't really use the vscode plugin, will the binary here on github be updated with 0.11.4 as well?
will the binary here on github be updated with 0.11.4 as well?
yes. ci will do it all. just wait it finish!
Amazing!!
Describe the bug After "Sync preview with current cursor", the preview in Firefox stops automatically updating the document. In the console you get the error message
and it links to the function
triggerUpdate
.It doesn't seem to be a problem in Safari.
To Reproduce Steps to reproduce the behavior:
Preview current file in browser
,Sync preview with current cursor
TypeError: translateMatch is null
Expected behavior Expected browser window to update
Package/Software version:
VSCode version(Help -> About):
typst-preview extension version:
v0.11.2
Logs:
typst-preview server log(Output Panel -> typst-preview):
typst-preview client log(Help -> Toggle Developer Tools -> Console):