Skip to content

Commit

Permalink
Fix issue NightlyCommit#348
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric MORAND committed Jun 4, 2019
1 parent d7a3a33 commit 0210526
Show file tree
Hide file tree
Showing 42 changed files with 1,637 additions and 1,484 deletions.
4 changes: 2 additions & 2 deletions src/core/filters/url-encode.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {isTraversable} from "../../helper/is-traversable";
import {iteratorToHash} from "../../helper/iterator-to-hash";

const http_build_query = require('locutus/php/url/http_build_query');

/**
* URL encodes (RFC 3986) a string as a path segment or a hash as a query string.
*
Expand All @@ -9,8 +11,6 @@ import {iteratorToHash} from "../../helper/iterator-to-hash";
* @returns {string} The URL encoded value
*/
export function twingFilterUrlEncode(url: string | {}): string {
const http_build_query = require('locutus/php/url/http_build_query');

if (typeof url !== 'string') {
if (isTraversable(url)) {
url = iteratorToHash(url);
Expand Down
2 changes: 1 addition & 1 deletion src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ return module.exports;
*/
compileSource(source: TwingSource): string {
try {
return this.compile(this.parse(this.tokenize(source)));
return this.compile(this.parse(this.tokenize(source).toAst()));
} catch (e) {
if (e instanceof TwingError) {
throw e;
Expand Down
272 changes: 135 additions & 137 deletions src/expression-parser.ts

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/extension/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ import {twingFunctionMax} from "../core/functions/max";
import {twingFunctionMin} from "../core/functions/min";
import {twingFunctionRange} from "../core/functions/range";
import {twingFunctionConstant} from "../core/functions/constant";
import {TwingTokenParserVerbatim} from "../token-parser/verbatim";

export class TwingExtensionCore extends TwingExtension {
private dateFormats: Array<string> = ['F j, Y H:i', '%d days'];
Expand Down Expand Up @@ -275,7 +276,8 @@ export class TwingExtensionCore extends TwingExtension {
new TwingTokenParserWith(),
new TwingTokenParserDeprecated(),
new TwingTokenParserAutoEscape(),
new TwingTokenParserSandbox()
new TwingTokenParserSandbox(),
new TwingTokenParserVerbatim()
];
}

Expand Down
Loading

0 comments on commit 0210526

Please sign in to comment.