f816955704
fix: in conditionals, don't render anything after an else branch ( #671 )
...
* fix: only render the first 'else' template in the case of multiples
* fix: empty else block and cases with when conditions
* fix: don't render elsif after else
* chore: Update src/tags/unless.ts
* chore: Update src/tags/if.ts
* chore: Update src/tags/case.ts
---------
Co-authored-by: Jun Yang <[email protected] >
2024-02-18 13:30:16 +08:00
629d958b86
feat: Array sum filter ( #661 )
...
* feat(filters): add array sum filter
* docs(filters): array sum filter
* docs: update versoin number in source/filters/sum.md
---------
Co-authored-by: Jun Yang <[email protected] >
2023-12-19 20:05:15 +08:00
Harttle
dd7616acb9
fix: allow unicode to be identifiers, fixes #655
2023-11-04 21:33:29 +08:00
Francisco Soto and Jun Yang
88aa63fd58
fix: handle windows newlines on newline_to_br and strip_newlines
2023-08-28 21:08:05 +08:00
Harttle
45adbd7008
fix: map filter allow nil results in strict mode, fixes #647
2023-08-24 00:20:57 +08:00
Jun Yang and GitHub
660d9be55f
feat: more flexible squared property read expression, fixes #643 ( #646 )
...
* fix: more flexible squared property read expression, fixes #643
* fix: unecessary error wrapping in browser bundles
* style: update code style and types
* perf: use token.value when evalToken
2023-08-23 00:45:49 +08:00
Francisco Soto and Jun Yang
dc6a301387
fix: for throws undefined var with a null value with strictVariables
2023-08-19 23:54:32 +08:00
Francisco Soto and Jun Yang
b8e7e2d946
fix: case should allow multiple values separated by or
...
This is supported by Shopify liquid.
2023-08-19 23:52:24 +08:00
Francisco Soto and Jun Yang
fc2731376f
fix: remove_last was eating an extra character
2023-08-17 21:43:21 +08:00
Jun Yang and GitHub
bf425c3adb
fix: allow quotes in inline comment tag, fixes #628
2023-07-07 22:48:55 +08:00
Harttle and Jun Yang
e401a30972
chore: split Github Actions workflows
2023-06-05 23:32:35 +08:00
Harttle
fcb930f0dd
fix: sample filter randomness and count=1 case
2023-06-04 13:34:16 +08:00
Harttle
3a67eb7f1c
fix: incorrect error message for browser UMD bundle
2023-06-04 12:00:32 +08:00
Harttle and Jun Yang
e347e603d7
feat: precise line/col for tokenization Error, #613
2023-06-04 02:06:42 +08:00
Harttle and Jun Yang
0480d3317d
fix: proper error message for filter syntax error, #610
2023-06-04 02:06:42 +08:00
Tomáš Hübelbauer and GitHub
db67118a75
test: Add tests for push ( #614 )
...
* Add support for the Jekyll sample filter
See https://jekyllrb.com/docs/liquid/filters
I am sorting the array randomly and then picking the first N items or all items if there is no sample limit.
* Add tests for `push`
I thought `push` was broken because it doesn't work on the Playground but that's not the case. Here are the tests to prove it. Taken from the `concat` tests.
* Remove the sample experiment
This got in from another branch lol.
* Recommend the build:dist command over the whole build
This one works for me locally whereas build:docs is reporting some issues.
* Return the full `build` command and explain how to use `commitlint` to workshop the message
I am working on a PR to make `build` run on macOS because it is a part of the pre-commit hook anyway so all contributors should make it work for them.
I have also shown how to check your messages against `commitlint` from the CLI because it is faster than using the VS Code GUI.
2023-05-30 00:06:22 +08:00
Tomáš Hübelbauer and GitHub
ba8b842452
feat: Add support for the Jekyll sample filter ( #612 )
...
* Add support for the Jekyll sample filter
See https://jekyllrb.com/docs/liquid/filters
I am sorting the array randomly and then picking the first N items or all items if there is no sample limit.
* Remove incorrect spaces before parens
Typo and copy-paste meet
2023-05-27 00:55:39 +08:00
Harttle and Jun Yang
33b3c010af
fix: incorrect timezone correction for DST dates, fixes #604
2023-04-25 01:28:48 +08:00
Harttle and Jun Yang
21ee27b575
fix: timezoneOffset ignored in date when preserveTimezones is enabled, fixes #605
2023-04-25 01:28:48 +08:00
Jun Yang
7b87ea82d3
feat: JSON format by space in json filter
2023-03-22 00:08:24 +08:00
Harttle and Jun Yang
9d823937cc
chore: upload npm errors for failed pipeline
2023-03-20 00:41:06 +08:00
Harttle and Jun Yang
c6cde9cd10
chore: migrate test cases from Chai to Jest
2023-03-20 00:41:06 +08:00
Harttle
771b9b9eba
style: fix code style
2023-03-03 00:14:38 +08:00
Harttle
9c0dc5fa39
fix: [expression] apply value equal for arrays, #589
2023-03-02 23:44:56 +08:00
Harttle
42d25902e8
fix: strip_html for multi line <script>/<style>/comments, #70
2023-03-02 23:01:15 +08:00
Jun Yang
d4e519c4a6
chore: update build badge, coverage to 100%, mv DEFAULT_FMT to defaultOptions
2023-02-23 01:05:54 +08:00
prassie and GitHub
3fb66465c6
feat: LiquidOptions.dateFormat to override default date format ( #587 )
...
doc: updates related to LiquidOptions.dateFormat
doc: revamped the date filter doc for easier reference
2023-02-22 23:56:33 +08:00
Slav Ivanov and Harttle
d489916231
fix: "ownPropertyOnly" not respected when passed via "renderOptions"
2023-02-14 22:39:38 +08:00
prassie and GitHub
a55f44f095
Added documentation for date ordinals support in date filter via %q ( #581 )
...
* Added date ordinals support in date filter via %q
* fix: validation regex for default date format
* fix: validation regex for default date format
2023-02-04 11:31:30 +08:00
Harttle and Harttle
3f21382d43
feat: support not operator, #575
2023-01-03 01:34:03 +08:00
Harttle and Harttle
aafaa0b4f9
feat: support calling date without format string, #573
2023-01-03 00:53:33 +08:00
Jun Yang
fb6a9f8717
fix: type compatible with v9 tag definition, support Context as scope in various render APIs, #570
2022-12-18 12:48:06 +08:00
Jun Yang
e6db371519
feat: support disable outputEscape for specific filters, #565
2022-12-12 02:17:18 +08:00
Jun Yang
d17813ef52
fix: case should render multiple when statements
2022-12-03 00:14:47 +08:00
James Prior and Jun Yang
6c3f1c1e0c
feat: add remove_last filter
2022-12-02 23:48:50 +08:00
James Prior and Jun Yang
b4d1e27420
feat: add replace_last filter
2022-12-02 23:48:50 +08:00
Harttle and Harttle
89c6c7676d
feat: timezone name for opts.timezoneOffset and date argument, fixes #553
2022-11-30 00:20:12 +08:00
Jun Yang
92992689cd
refactor: Tag class support in registerTag()
2022-11-27 14:04:01 +08:00
Jun Yang
b115077e12
refactor: remove use of internal Context class in evalValue argument
...
BREAKING CHANGE: `evalValue` won't support `Context` as second argument anymore.
2022-11-27 14:04:01 +08:00
Jun Yang
bb58d3e549
refactor: delay creation of operatorsTrie and hide this implementation
...
BREAKING CHANGE: use `operators` instead of `operatorsTrie` as Tokenizer constructor argument, #500
2022-11-27 14:04:01 +08:00
Jun Yang
ff112a4750
chore: rename filters to snake style, #487
...
BREAKING CHANGE: keys in `<liquidjs>.filters` are now in snake case (instead of camel case), identical to that in Liquid template.
2022-11-27 14:04:00 +08:00
Jun Yang
7a714855df
feat: support timezone offset argument for date filter, #553
2022-11-27 13:46:51 +08:00
Harttle and Harttle
32f613fb43
fix: truncatewords should use at least one word, #537
2022-10-21 14:40:25 +08:00
Harttle and Harttle
bbf00f37bf
feat: promise in expression & nested property, #533 #276
2022-08-27 23:19:16 +08:00
Harttle and Harttle
071368afe1
feat: use evalValue to parse & render expression, #527
2022-08-24 20:46:22 +08:00
Harttle and Harttle
e874b4060b
feat: export toValueSync & defaultOptions to evaluate expression, see #527
2022-08-15 01:53:48 +08:00
Harttle and Harttle
4ad383d9be
fix: expression support Drop.valueOf, fixes #522
2022-07-21 01:21:58 +08:00
Harttle
c41a5d5bab
fix: throw ParseError instead of RenderError for invalid assign expression, closes #519
2022-07-15 00:41:51 +08:00
Harttle
4289b4e804
refactor: rename toValue to toValueSync
2022-07-10 00:24:00 +08:00
Harttle
c3e51caa70
fix: for tag not respecting Drop#valueOf(), fixes #515
2022-07-09 22:21:51 +08:00