From 6e2c6ff8f34f4050812eb194609b24a5b54edbbc Mon Sep 17 00:00:00 2001 From: RGBCube Date: Wed, 28 Feb 2024 13:24:22 +0300 Subject: [PATCH] Fix raw escapes on their own --- flake.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 0b80cd5..a680992 100644 --- a/flake.nix +++ b/flake.nix @@ -4,13 +4,15 @@ inputs.nixpkgslib.url = "github:nix-community/nixpkgs.lib"; outputs = { self, nixpkgslib }: let + inherit (nixpkgslib) lib; + first = n: builtins.substring 0 n; dropFirst = n: string: builtins.substring n (builtins.stringLength string - n) string; last = n: string: builtins.substring (builtins.stringLength string - n) n string; dropLast = n: string: builtins.substring 0 (builtins.stringLength string - n) string; - escapix = import ./escape.nix nixpkgslib.lib; + escapix = import ./escape.nix lib; inherit (escapix) escape; attrsetToHtmlAttrs = attrs: @@ -31,7 +33,7 @@ call = builtins.scopedImport { inherit (self) raw call __findFile; - inherit (nixpkgslib) lib; + inherit lib; }; result = self.call /${builtins.getEnv "TARGET_FILE"}; @@ -40,8 +42,8 @@ outPath = dottedNameToTag name; __functor = this: next: - # Not an attrset. Just escape and add it onto the HTML. - if !builtins.isAttrs next + # Not an attrset or an escaped one. Just toString it and add it onto the HTML. + if builtins.isAttrs next -> lib.hasSuffix "-_" next.outPath or "" then this // { outPath = (toString this) + escape (toString next); }