-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New renderer fails in preview mode sometimes #12
Comments
Perhaps it's something to do with this section of code.. Lines 209 to 219 in f01148c
Specifically, const pxToPt = (px: number) => (px * dpr * (72 / 96)).toString() + "pt" |
I can't seem to reproduce it from the source you've given, but as you've said it appears to be rare. If you see it happen again can you open the console (Ctrl+shift+I) show me the logs/erros in there? Its not Have you also modified the preambles in anyway? |
I can reproduce this in a new plain vault with Typst Renderer installed and the math override option turned on.
It looks like the Typst renderer gets particularly tripped up after it successfully embeds another note: # Asymptotic Notation Rules
- We can **drop constants**: If $c > 0$ then $c f$ is $Theta(f)$.
![Big o Types](big-o-types)
# Asymptotic Notation Rules
- We can **drop constants**: If $c > 0$ then $c f$ is $Theta(f)$. In this example, the first bullet point will render successfully, but the latter will not. I need to have a decent amount of notes before and after this section of my note file before the Typst renderer will fail. Let me know how you would like me to transmit you the obsidian repro of this (I'd rather not share it publicly on GitHub) -- e.g., through a GPG public key I can sign to or if you're on the Typst Discord. |
Just added a debug statement in the piece of the code that I referenced in my comment -- the output after the embedded note part of my note is as expected:
So looks like It looks like let fontSize = parseFloat(this.getCssPropertyValue("--font-text-size")); is failing (i.e., this is where |
I don't know why |
Just sent the repro files in Discord. |
I could reproduce the error with the supplied reproduction files, as of 05b1a9a the error no longer occurs so this is fixed :) |
Thanks! |
Just updated from the previous version of this plugin and it appears to fail to render some typst blocks in preview mode:
![image](https://private-user-images.githubusercontent.com/46231745/256441494-61c6bcd0-2535-4a66-9616-b8385b0e4c2f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1ODc5NjUsIm5iZiI6MTczOTU4NzY2NSwicGF0aCI6Ii80NjIzMTc0NS8yNTY0NDE0OTQtNjFjNmJjZDAtMjUzNS00YTY2LTk2MTYtYjgzODViMGU0YzJmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDAyNDc0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU3MDBiMmQ3NTFhOTU0Y2RmNmIzNjUzODA4NWM0NWJlMTY2M2RiZjlkYmJhZjMyMzNkNTdjNWRjNGYwMjBmZjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.GVX9ZeeZlYB9jpxg5v_lhYx9HY9ULzvZwi3MHikzb10)
In edit mode (working correctly):
The raw source:
![image](https://private-user-images.githubusercontent.com/46231745/256441702-9cde338d-ce38-43d9-b28a-baf0b44a5d4a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1ODc5NjUsIm5iZiI6MTczOTU4NzY2NSwicGF0aCI6Ii80NjIzMTc0NS8yNTY0NDE3MDItOWNkZTMzOGQtY2UzOC00M2Q5LWIyOGEtYmFmMGI0NGE1ZDRhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDAyNDc0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM1NGVlYzFlNjUzODU2ZDI1Mjk1OGI3OTg5ODgzYjY2ZTM0NDdjZGYxYzUzNmNjMWExOTMxYmJkZjgwODJlMTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.OMRORiW01ahk56RbH4gyK9Bz-dWsmA7pbFl9P5Oe8ww)
I can't seem to find a solid repro for this issue, but it appears to happen quite consistently in one vault.
The full error is
Strangely, modifying the source typst block which fails to render, toggling to preview, and changing back to the original source will allow for it to render correctly (for a while).. Is this a cache issue somehow?
I notice that for a given page, the content at the top is much more likely to render successfully than the content at the bottom. It seems to be arbitrary where the content will fail to render -- so seems like there is a race condition almost going on somewhere.
The text was updated successfully, but these errors were encountered: