Skip to content

Commit

Permalink
0.7.6 (#51)
Browse files Browse the repository at this point in the history
* πŸ› Fix JSON/list parsing in certain cases (#50)

* πŸ”– 0.7.6

* πŸ› Futher fix #50

* Update deps

* Update deps

* Update deps

* πŸ’š Fix CI

* πŸ’š Add python 3.10 in CI

* πŸ”– 0.7.6
  • Loading branch information
pwwang authored Oct 27, 2022
1 parent 74ab6be commit c0e398d
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 129 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
jinja2: [
jinja2==3.0.*,
jinja2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,4 @@ docs/api/
docs/index.md

.history/
_t.py
49 changes: 27 additions & 22 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
# 0.7.5
# Change Log

## 0.7.6

- πŸ› Fix JSON/list parsing in certain cases (#50)

## 0.7.5

- ✨ Implement a playground powered by pyscript
- ✨ Add filter `call` for `wild` mode

# 0.7.4
## 0.7.4

- βœ… Add tests regarding #47
- πŸ“Œ Upgrade and pin dependencies

# 0.7.3
## 0.7.3

- 🩹 Make `default` filter work with `None`
- 🩹 Make `attr` filter work with dicts
- 🩹 Use filter `liquid_map`, in wild mode, instead of `map`, which is overridden by python's builtin `map`

# 0.7.2
## 0.7.2

- πŸ› Fix `date` filter issues (#38, #40)
- ✨ Add `markdownify` for jekyll (#36, #37)
Expand All @@ -26,48 +32,47 @@
- ✨ Add jekyll filters `xml_escape`, `cgi_escape` and `uri_escape`
- ✨ Add `int`, `float`, `str` and `bool` as both filters and globals for all modes (#40)


# 0.7.1
## 0.7.1

- ✨ Add `regex_replace` filter
- ✨ Allow absolute path and pathlib.Path passed as template files
- ✨ Allow `+/-` to work with date filter (#38)
- ✨ Add `filters_as_globals` for wild mode (defaults to `True`)

# 0.7.0
## 0.7.0

- Reimplement using jinja2

# 0.6.4
## 0.6.4

Last release of 0.6, for compatibilities.

- Add regex_replace filter (#33)

# 0.6.3
## 0.6.3

- Allow tag for to have output(test | filter) in python mode.
- Fix stacks not print in some cases.
- Avoid closing stream after parsing
- Add better error message for attribute error while rendering
- Print 'KeyError' for render error if it is a KeyError.

# 0.6.2
## 0.6.2

- Update dependency versions

# 0.6.1
## 0.6.1

- Fix use of LiquidPython
- Add getitem and render filter for python mode
- Fix EmptyDrop for variable segment in python mode
- Fix re-rendering error for extends tag (#29)

# 0.6.0
## 0.6.0

- Remodel the package to use a lexer to scan the nodes first and then lark-parse to parse the tag.

# 0.5.0
## 0.5.0

- Extract major model of node to allow `register_node` (#18)
- Introduce `config` node and deprecate `mode`
Expand All @@ -78,38 +83,38 @@ Last release of 0.6, for compatibilities.
- Require backtick ``( ` )`` for liquidpy expression to be used in statement nodes
- Add API documentations

# 0.4.0
## 0.4.0

- Implement issue #13: Adding ternary end modifier (`$`)
- Expand list/dict context in debug information

# 0.3.0
## 0.3.0

- Force explict modifiers (=/!) for True/False action in ternary filters
- Add combined ternary filters
- Add shortcut `?` for `?bool`
- Use the maximum lineno on traceback instead of the last one.

# 0.2.3
## 0.2.3

- Fix parsing errors when unicode in a template loaded from text #10 (thanks to vermeeca)

# 0.2.2
## 0.2.2

- Show shortened context in debug information
- Fix #9: stream cursor shifted when unicode in the template.

# 0.2.1
## 0.2.1

- Fix #7: forloop problem with nesting for statements
- Fix other bugs

# 0.2.0
## 0.2.0

- Add inclusion and inheritance support
- Add `cycle` for `for` loop

# 0.1.0
## 0.1.0

- Rewrite whole engine using a stream parser
- Support multi-line for statements, expressions and tag comments (#1)
Expand All @@ -122,12 +127,12 @@ Last release of 0.6, for compatibilities.
- Add tenary filters
- Remove `&` modifiers

# 0.0.7
## 0.0.7

- Allow `{% mode %}` block to be anywhere in the source code
- Full the coverage
- Change support only for python3.5+

# 0.0.6
## 0.0.6

- Add modifiers `&` and `*` to allow chaining and expanding arguments
2 changes: 1 addition & 1 deletion liquid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

patch_jinja()

__version__ = "0.7.5"
__version__ = "0.7.6"
13 changes: 6 additions & 7 deletions liquid/exts/filter_colon.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,21 @@ def filter_stream(self, stream: "TokenStream") -> Iterable[Token]:
# print(token.value, token.type)
if flag == 0 and token.type is TOKEN_PIPE:
flag = 1
yield token
elif token.type is TOKEN_NAME and flag == 1:
flag = 2
yield token
elif token.type is TOKEN_COLON and flag == 2:
flag = 3
yield Token(token.lineno, TOKEN_LPAREN, None)
token = Token(token.lineno, TOKEN_LPAREN, None)
elif token.type is TOKEN_COLON and flag == 3:
# {{ a | filter: 1, x: 2}} => {{ a | filter: 1, x=2}}
yield Token(token.lineno, TOKEN_ASSIGN, None)
token = Token(token.lineno, TOKEN_ASSIGN, None)
elif (
token.type in (TOKEN_VARIABLE_END, TOKEN_BLOCK_END, TOKEN_PIPE)
and flag == 3
):
flag = 1 if token.type is TOKEN_PIPE else 0
yield Token(token.lineno, TOKEN_RPAREN, None)
yield token
else:
yield token
elif token.type in (TOKEN_VARIABLE_END, TOKEN_BLOCK_END):
flag = 0

yield token
Loading

0 comments on commit c0e398d

Please sign in to comment.