doc: fix longestFence usage of lib.max (#1231)
Fixes: 6e55a89494 ("doc: ensure code blocks are safely fenced (#1218)")
Link: https://github.com/danth/stylix/pull/1231
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
parent
6e55a89494
commit
78a96c5c5a
1 changed files with 3 additions and 1 deletions
|
|
@ -306,8 +306,10 @@ let
|
|||
remainingStr = builtins.elemAt groups 1;
|
||||
prevLen = builtins.stringLength prev;
|
||||
currLen = builtins.stringLength current;
|
||||
longest = lib.max currLen prevLen;
|
||||
# Reduce to the longest of `prev` & `current`
|
||||
longest = if currLen > prevLen then current else prev;
|
||||
in
|
||||
# If no more matches for "`", return; otherwise keep looking
|
||||
if groups == null then prev else longestFence' longest remainingStr;
|
||||
|
||||
# Renders a value, which should have been created with either lib.literalMD
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue