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

%% anywhere in input is now replaced with % #384

Closed
kroeschl opened this issue Jan 25, 2024 · 5 comments
Closed

%% anywhere in input is now replaced with % #384

kroeschl opened this issue Jan 25, 2024 · 5 comments

Comments

@kroeschl
Copy link

Starting with Mako 1.3.1, %% anywhere in input now renders to %. This is a change in behavior from previous releases.

It's unclear to me if this is intended. The documentation says that %% can be used to render a % at the start of a line, but it doesn't explicitly state how %% is handled elsewhere in a line. My first interpretation was that %% elsewhere in a line wouldn't be changed.

Simple reproducing case:

$ pip install mako==1.3.0
...
Successfully installed mako-1.3.0
$ mako-render - <<< foo%%bar
foo%%bar
$ pip install mako==1.3.1
...
Successfully installed mako-1.3.1
$ mako-render - <<< foo%%bar
foo%bar

This is related to #383. From the discussion there, it seems like this was expected to possibly break users, but it's not clear to me if it was expected to break all use of %% not at the start of a line or just %% at the start of a line after whitespace (which I would expect).

@zzzeek
Copy link
Member

zzzeek commented Jan 25, 2024

hi -

I just read your case more closely, and I deleted what I wrote since I assumed you were referring to the simple behavioral change of % as the first non-whitespace character.

I will evaluate your case, but I am leaning towards releasing this as Mako 1.4.0 with a stronger note and backwards compatibility note, revoking 1.3.1

@zzzeek
Copy link
Member

zzzeek commented Jan 25, 2024

I've yanked the release and reverted the change.

@kroeschl
Copy link
Author

Perfect, thanks for the quick response!

@zzzeek
Copy link
Member

zzzeek commented Jan 25, 2024

please note that the fix will still impact double percent signs as the first non whitespace character on a line

@zzzeek
Copy link
Member

zzzeek commented Jan 30, 2024

a new version of this fix is merged in 1d6c58e and I'm going to put 1.3.2 out with it. since it's the only change again, if more issues we can keep reverting until we get it right (I haven't spent much time on Mako in over a decade)

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

No branches or pull requests

2 participants