This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes#2427).
Discussion
----------
Fixed JS escaping for unicode characters with higher code points
Unicode characters with higher code points were being escaped incorrectly. When these characters are escaped, they should maintain their surrogate halves. Previously, Twig was dropping the first surrogate half.
https://mathiasbynens.be/notes/javascript-escapes#unicode-code-point
> The tetragram for centre symbol (𝌆) has code point U+1D306, so you could write it as \u{1D306}. For comparison, if you were to use simple Unicode escapes to represent this symbol, you’d have to write out the surrogate halves separately: '\uD834\uDF06'.
Commits
-------
7f913495 Fixed JS escaping for unicode characters with higher code points
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes#2422).
Discussion
----------
Updated the vim-twig link
The other project is not maintained anymore and the author recommends this fork.
Commits
-------
955d5abd Updated the vim-twig link
This PR was merged into the 1.x branch.
Discussion
----------
PHPUnit 6 compatability
This should make builds on Traivs CI green again.
Commits
-------
0d791de6 PHPUnit 6 compatability
This PR was squashed before being merged into the 2.x branch (closes#2415).
Discussion
----------
Add error message when calling parent() in a block that doesn't exist
Related: #2309
When calling `parent()` in a block that isn't defined in the parent template, you get an error message that states `Block "%s" on template "%s" does not exist`, even if the block is wrapped in an `is defined` check, which is confusing and makes debugging hard.
This fix adds a better error message indicating that you should not call `parent()` when the parent block is not defined.
Before:

After:

Commits
-------
4587f676 Add error message when calling parent() in a block that doesn't exist
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes#2421).
Discussion
----------
Fix codeblock in recipes documentation
Commits
-------
adba4c2a Fix codeblock
This PR was merged into the 2.x branch.
Discussion
----------
Fix undef. source in exception.
closes https://github.com/twigphp/Twig/issues/2383
Two things:
- the tests fails without a corrupt cache, so maybe the message is of or the cache generation is off (i.e. not respecting the `$index`)
- passing the `$source` seems superfluous (but maybe that is only the case in the exception message)
Commits
-------
772373cf Fix undef. source in exception.
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes#2403).
Discussion
----------
#1802 left/right trim
It was said in this thread that there was a preference of adding parameters to the trim filter in order to implement this.
So this feature works like:
trim(character_mask, mode), where mode is either "both", "left" or "right". It is by default "both".
This is my first pull request of this project, so I apologise in advance if something is wrong.
Commits
-------
7d8e7550#1802 left/right trim
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes#2406).
Discussion
----------
Fix tokenize call in DeprecationCollector
Hi,
if fixes `Argument 1 passed to Twig_Environment::tokenize() must be an instance of Twig_Source, string given`
Commits
-------
13ca97c1 Fix tokenize call in DeprecationCollector
* 1.x:
fixed tests for PHP 5.2
fixed tests for PHP 5.2
fixed tests for PHP 5.2
Fix typo in test filename
added a note in the docs about the PSR-11 runtime loader
fixed typo
updated CHANGELOG
bumped version to 1.32
Add ContainerRuntimeLoader
tweaked docs
Update striptags.rst
fixed CS
Mention autoescape=true deprecation (issue #2386)
Fix typo.
bumped version to 1.31.1-DEV
prepared the 1.31.0 release
added a note about macros usage in the deprecated docs