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

Prioritize macros above other inline patterns #223

Merged
merged 2 commits into from
Aug 7, 2024

Conversation

benbdeitch
Copy link

@benbdeitch benbdeitch commented Jul 24, 2024

Closes: internetarchive/openlibrary#9036

Problem:
Currently, including an inline pattern within a macro breaks the whole process; this is untenable, since it means that escaping a character in an argument renders it wholly unworkable.

Solution:
This fix places macros at the beginning of the list of inline patterns, prioritizing them above inline patterns. This has no effect on anything outside of macros, so there should be no negative side effects. Breaking up the {{function()}} pattern into \{\{function()\}\} still allows for the code to be typed, but not executed.

Testing:
Play around with the macros in a custom page. In the live version, escaping a character within the arguments prevents it from working, but it should be functional now.

Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Niiiice! Great find! (Also: oh dear infogami has a home-baked markdown renderer...?!?)

I put on testing and tested the page that was previously not working: https://testing.openlibrary.org/collections/nyt-bestsellers and it works now! I also checked some other pages, e.g. subjects, other collections and they seem to be working correctly as well 👍

@cdrini cdrini merged commit cb117b0 into internetarchive:master Aug 7, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Carousels don't support ' character in subjects
2 participants