Closed miltondp closed 7 months ago
I will update the documentation about this. Originally I planned to have plain strings be exact matches but at some point I removed that and forgot to update the documentation.
Unfortunately, the filter always receives a plain string (because it comes from liquid/jekyll which doesn't have a special type for regex) and then has to decide whether to treat it as an exact match or regex somehow. I guess I could try to check for if the string contains special regex characters like +
or *
, but that could be brittle. It's probably best to just always treat it like a regex, and thus a plain string like "lab" would just be a partial match, and you'd have to do ^lab$
for an exact match.
I agree!
On Wed, Apr 17, 2024, 1:29 PM Vincent Rubinetti @.***> wrote:
I will update the documentation about this. Originally I planned to have plain strings be exact matches but at some point I removed that and forgot to update the documentation.
Unfortunately, the filter always receives either a plain string and then has to decide whether to treat it as an exact match or regex somehow. I guess I could try to check for if the string contains special regex characters like + or *, but that could be brittle. It's probably best to just always treat it like a regex, and thus a plain string like "lab" would just be a partial match.
— Reply to this email directly, view it on GitHub https://github.com/greenelab/lab-website-template/issues/255#issuecomment-2062058409, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABKFD7GK3QU77G3TRKQPO3Y53ERVAVCNFSM6AAAAABGL5CY56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRSGA2TQNBQHE . You are receiving this because you authored the thread.Message ID: @.***>
Checks
Link to your website repo
https://github.com/pivlab/pivlab-website
Version of Lab Website Template you are using
1.2.0
Description
I created this PR on my lab's website repo to change the order in which lab members are shown. I found that the
filters
parameter of the List component does not match values exactly; instead, it looks for substrings. For instance, if you have two roles in_data/types.yaml
namedprogrammer
andprogrammer-lab
, a filter withrole: programmer
will match both.This could be fixed by changing the documentation of the List component.
This is how I fixed the bug (see
$
at the end ofrole
in second line):