Skip to content

Conversation

@roed314
Copy link
Member

@roed314 roed314 commented Oct 10, 2025

If you try to add a cite command with a hashtag (which will be common for citations to mathlib), the knowl processing code currently raises an error. For example, try adding

\cite{mathlib:Algebra/Group/Defs.html#inv_mul_cancel_comm}

to the end of any knowl text while editing and look at the preview. After this PR, it works.

However, in order to fix it, we break the links created by using a hash keyword (like #Maass)

@roed314 roed314 added the knowls Displaying or editing knowls (not content related) label Oct 10, 2025
@edgarcosta
Copy link
Member

I cannot look at this right now, but I faced this same issue before, and one needs to be quite carefull

@roed314
Copy link
Member Author

roed314 commented Oct 11, 2025

Another option would be to turn off the hashtag pattern replacer, but I'm not sure how much that's used in our current knowls.

@roed314
Copy link
Member Author

roed314 commented Oct 11, 2025

For the record, the places where the hashtag pattern replacer are intentionally used are:

Except for the last test knowl, all end with Keywords: #Maass #Picard or Keywords: #Picard #Laplacian or Keywords: #Sage, which link to knowl search results.

There is also modcurve.cusp_widths.1711022896125866.comment where the replacement was unintentionally triggered.

I think it would be fine to drop this hashtag feature in order to not have to worry about changing the order as is currently done in this PR, but then I've never really been a hashtag fan.

@edgarcosta
Copy link
Member

I agree that the we should get rid of the hashtag feature for keywords

@roed314
Copy link
Member Author

roed314 commented Oct 14, 2025

Done. To review,

  • make sure that you're happy with how the hashtags look in the knowls I mentioned above (e.g. mf.maass.picard)
  • Check that you can add a mathlib link (e.g. edit any knowl, add \cite{mathlib:Algebra/Group/Defs.html#inv_mul_cancel_comm} to the end, make sure it previews correctly, then cancel your change).

@roed314 roed314 changed the title Change order of processing between markdown and jinja Disable automatic hashtag links in knowls Oct 20, 2025
@AndrewVSutherland AndrewVSutherland merged commit 7d1e2a6 into LMFDB:main Oct 20, 2025
13 checks passed
@roed314
Copy link
Member Author

roed314 commented Oct 20, 2025

I've removed all of the existing hashtag links (listed in this comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

knowls Displaying or editing knowls (not content related)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants