Skip to content

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

Closed

Description

@kroeschl

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).

Activity

  1. zzzeek commented on Jan 25, 2024

    @zzzeek
    Member

    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

  2. zzzeek commented on Jan 25, 2024

    @zzzeek
    Member

    I've yanked the release and reverted the change.

  3. kroeschl commented on Jan 25, 2024

    @kroeschl
    Author

    Perfect, thanks for the quick response!

  4. zzzeek commented on Jan 25, 2024

    @zzzeek
    Member

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

  5. added a commit that references this issue on Jan 25, 2024
    edf44dc
  6. zzzeek commented on Jan 30, 2024

    @zzzeek
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions