temme
temme copied to clipboard
Allow spaces around the pipe operator
Please allow spaces to be used around the pipe operator (|
). They make filters much easier to read.
Before:
div.movies@ {
.title { $title };
.date { $date };
.duration { $duration|match("\\d+")|get(0)|Number };
}
After:
div.movies@ {
.title { $title };
.date { $date };
.duration { $duration | match("\\d+") | get(0) | Number };
}
Nice idea. I'll investigate it in recent days.
For now, you may use a customized filter to enhance the readability 😄
filter getFirstNumber() {
return Number(this.match("\\d+")[0])
}
div.movies@ {
.title { $title };
.date { $date };
.duration { $duration|getFirstNumber };
}