From ac530f492d9d8324747a2a85a6677a8e0cb294d1 Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Fri, 6 Jun 2025 09:37:06 -0400 Subject: [PATCH 1/2] Revert change to `snippet` filter. --- _plugins/filters.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/_plugins/filters.rb b/_plugins/filters.rb index d67cdbc1..9d239ce1 100644 --- a/_plugins/filters.rb +++ b/_plugins/filters.rb @@ -92,7 +92,13 @@ def snippet(file,type,number) from,to = from.to_i,to.to_i - range = parse_range_string(number) + if from > to + raise ArgumentError, <<-MSG +Line number from > to in 'snippet' filter +MSG + end + + range = from..to if type =~ /^line/ if to > content.lines.count From 48c10645082d38d0a1a2cff910e712afd1f0526f Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Fri, 6 Jun 2025 09:37:16 -0400 Subject: [PATCH 2/2] Fix ranges for `tagged_snippet` filter. --- tutorials/clocks/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/clocks/index.md b/tutorials/clocks/index.md index 83d6f9f2..90f21e77 100644 --- a/tutorials/clocks/index.md +++ b/tutorials/clocks/index.md @@ -169,11 +169,11 @@ read in the tree estimated by {% cite DosReis2012 %}. From the tree we can initialize some useful variables. (These can also be created from the data matrix using the same methods.) -{{ BDP_script | tagged_snippet: "### get helpful variables from the tree", "2" }} +{{ BDP_script | tagged_snippet: "### get helpful variables from the tree", "1-2" }} Finally, we initialize a variable for our vector of moves and monitors. -{{ BDP_script | tagged_snippet: "## Initialize move and monitor vectors", "2" }} +{{ BDP_script | tagged_snippet: "## Initialize move and monitor vectors", "1-2" }} ### Birth-Death Parameters