Skip to content
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

Block References are not rendered properly #1102

Open
sgorblex opened this issue Apr 21, 2024 · 0 comments
Open

Block References are not rendered properly #1102

sgorblex opened this issue Apr 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@sgorblex
Copy link

Describe the bug
Block References are sometimes not detected, never linked properly, and the scroll is usually imprecise and inconsistent.

not detected: in some cases (see example) adding ^exampleref is ignored by the preprocessors and rendered as it is. I couldn't find a general rule for this to happen but it switches behavior depending on if it is on an itemization, if it has subitems, if it has previous items (and more). It's inconsistent and weird.

linked properly: the generated IDs do not contain the symbol ^, while the links do. It works for headings (which do not contain ^ in links), but breaks for block references (which do). Also, the links should preserve capitalization and are lower case instead.

scroll: I have no idea what happens but when the links work, even for headings sometimes, the scroll seems to go to a random place in the page. It is usually correct for the first time, but breaks after that. This was also mentioned in #1058

To Reproduce
Here is a somewhat minimal example that does not render the ID for one block and renders a broken link for another one (the links with no ^ were manually modified):

first: [[#^detected]]

second: [[#^notdetected]]

first (no `^`): [[#detected]]

second (no `^`): [[#notdetected]]

- first ^detected
- second ^notdetected
	- subitem1
	- subitem2

The only link with the appropriate behavior is "second (no ^)", however I manually removed ^ which should be included in the ID of the block instead.

Expected behavior

  1. insert ^SomeTag in a block (possibly a complicated block like a nested item in a list)
  2. insert a link [[#^SomeTag|Optional text]] to the block somewhere
  3. render with quartz
  4. in the rendered version, click on the link
  5. the browser should bring you to the exact location of the block tagged

Desktop (please complete the following information):

  • Quartz Version: 4.2.3
  • node Version: v21.7.3
  • npm version: 10.5.2
  • OS: Arch Linux (Linux 6.8.6)
  • tested on Firefox 125.0.1 and Chromium 124.0.6367.60

I tried to look into it to see if I could fix it or at least give some more insights but frankly I don't have the knowledge. Thanks in advance for any time spent on this :)

@sgorblex sgorblex added the bug Something isn't working label Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant