rawleyfowler / Humming-Bird

A fun and performant web application framework for Raku
MIT License
44 stars 6 forks source link

filenames aren't parsed correctly in Glue #69

Closed drudgesentinel closed 1 year ago

drudgesentinel commented 1 year ago

Hello! I'm noodling around the framework, and I've found behavior that I think is unintended. I wanted to get some clarification on how this should look to make sure I'm understanding the issue correctly and would like to submit a PR to sort it.

The issue lies here: https://github.com/rawleyfowler/Humming-Bird/blob/35ca50b641a878209d7a6b1f73fe4bbfe2d118c1/lib/Humming-Bird/Glue.rakumod#L188C25-L196C22

The naming syntax shortens the filename, and also removes the extension. Here's a trivial example using the same regex:

my $example-file = "name=\"pexels-photo-132204.jpg\"";
my $name = $example-file.match(/'name="'<(\w+)>'";'?.*/).Str;
say $name; #pexels

It looks like both the name (from whatever template or markdown) and filename properties are both affected.

So what I wanted to verify is-

1) Is it intended to retain the file extension in filename (I'm assuming yes, but I'm noob so wanted to clarify 2) I'm happy to provide a more specific regex in PR form that would address the desired formatting of that property

Let me know if you'd like additional clarification, or if my example doesn't make sense.

Thanks!

rawleyfowler commented 1 year ago

@goldendemise Yes it is intended to keep the extension. I would very much appreciate a PR to fix this!

rawleyfowler commented 1 year ago

Fixed with #70