express-hbs
Advanced tools
Comparing version 2.4.0 to 2.4.1
@@ -8,7 +8,13 @@ 'use strict'; | ||
var ID_LENGTH = 8; | ||
var ID_PREFIX = '__aSyNcId_<_'; | ||
var ID_PREFIX = '__aSyNcId__'; | ||
// NOTE: We must include a character which is escaped by Handlebars in the "async id" | ||
// This is so that when using an async helper "inline", such as {{asyncHelper "foo"}} | ||
// the content is correctly escaped depending on whether double or triple braces. | ||
var ID_ESCAPED_STRING = '<_'; | ||
var ID_SUFFIX = '__'; | ||
function resolve(cache, fn, context) { | ||
var id = ID_PREFIX + generateId(ID_LENGTH) + ID_SUFFIX; | ||
var id = ID_PREFIX + ID_ESCAPED_STRING + generateId(ID_LENGTH) + ID_SUFFIX; | ||
cache[id] = new Promise(function(passed, failed) { | ||
@@ -35,2 +41,5 @@ try { | ||
function hasResolvers(text) { | ||
// NOTE: We specifically search the text for the ID_PREFIX **NOT** including the escapable character | ||
// This is because that character can be escaped in the text, and lead us to not finding unresolved | ||
// async helper outputs. | ||
if (text.search(ID_PREFIX) > 0) { | ||
@@ -37,0 +46,0 @@ return true; |
{ | ||
"name": "express-hbs", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"description": "Express handlebars template engine complete with multiple layouts, partials and blocks.", | ||
@@ -32,10 +32,10 @@ "keywords": [ | ||
"devDependencies": { | ||
"cookie-parser": "1.4.5", | ||
"eslint": "7.24.0", | ||
"express": "4.17.1", | ||
"i18n": "0.13.2", | ||
"mocha": "8.3.2", | ||
"cookie-parser": "1.4.6", | ||
"eslint": "8.47.0", | ||
"express": "4.18.2", | ||
"i18n": "0.15.1", | ||
"mocha": "10.2.0", | ||
"nyc": "15.1.0", | ||
"rewire": "5.0.0", | ||
"supertest": "6.1.3" | ||
"rewire": "7.0.0", | ||
"supertest": "6.3.3" | ||
}, | ||
@@ -42,0 +42,0 @@ "dependencies": { |
@@ -304,2 +304,2 @@ # express-hbs | ||
Copyright (c) 2012-2021 Barc, Inc., Ghost Foundation - Released under the [MIT license](LICENSE). | ||
Copyright (c) 2012-2023 Barc, Inc., Ghost Foundation - Released under the [MIT license](LICENSE). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
85971
2104