Skip to content

Commit 68491d0

Browse files
alandefreitasvinniefalco
authored andcommitted
fix: inverse blocks with no helpers expand expressions
1 parent fda33b1 commit 68491d0

File tree

7 files changed

+147
-98
lines changed

7 files changed

+147
-98
lines changed

CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@ if (MRDOX_BUILD_TESTS)
321321
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
322322
endif()
323323

324+
add_executable(handlebars-test test/unit/handlebars.cpp)
325+
target_link_libraries(handlebars-test PUBLIC mrdox-core)
326+
target_compile_definitions(handlebars-test PRIVATE -DMRDOX_UNIT_TEST_DIR="${CMAKE_CURRENT_SOURCE_DIR}/test/unit")
324327
endif()
325328

326329

include/mrdox/Support/Handlebars.hpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct HandlebarsOptions
3434
{
3535
/** Escape HTML entities
3636
*/
37-
bool noHTMLEscape = false;
37+
bool noEscape = false;
3838

3939
/** Templates will throw rather than ignore missing fields
4040
*/
@@ -1062,7 +1062,7 @@ class Handlebars {
10621062
dom::Value const &context,
10631063
HandlebarsOptions opt,
10641064
partials_map& inlinePartials,
1065-
dom::Object const& private_data,
1065+
dom::Object const& data,
10661066
dom::Object const& blockValues) const;
10671067

10681068
void
@@ -1073,7 +1073,7 @@ class Handlebars {
10731073
dom::Value const &context,
10741074
HandlebarsOptions opt,
10751075
partials_map& inlinePartials,
1076-
dom::Object const& private_data,
1076+
dom::Object const& data,
10771077
dom::Object const& blockValues) const;
10781078

10791079
void
@@ -1093,10 +1093,10 @@ class Handlebars {
10931093
Handlebars::Tag const& tag,
10941094
OutputRef &out,
10951095
std::string_view &templateText,
1096-
dom::Value const& data,
1096+
dom::Value const& context,
10971097
HandlebarsOptions &opt,
10981098
Handlebars::partials_map &inlinePartials,
1099-
dom::Object const& private_data,
1099+
dom::Object const& data,
11001100
dom::Object const& blockValues) const;
11011101

11021102
void
@@ -1116,7 +1116,7 @@ class Handlebars {
11161116
std::string_view &templateText,
11171117
dom::Value const& context,
11181118
HandlebarsOptions const& opt,
1119-
dom::Object const& private_data,
1119+
dom::Object const& data,
11201120
dom::Object const& blockValues) const;
11211121

11221122
void
@@ -1277,7 +1277,7 @@ escapeExpression(
12771277
{{person/firstname}} {{person/lastname}}
12781278
@endcode
12791279
1280-
@param data The object to look up the property in
1280+
@param context The object to look up the property in
12811281
@param path The path to the property to look up
12821282
12831283
@return The value of the property, or nullptr if the property does not exist
@@ -1286,21 +1286,21 @@ escapeExpression(
12861286
MRDOX_DECL
12871287
std::pair<dom::Value, bool>
12881288
lookupProperty(
1289-
dom::Value const &data,
1289+
dom::Value const & context,
12901290
std::string_view path);
12911291

12921292
/// @copydoc lookupProperty
12931293
MRDOX_DECL
12941294
std::pair<dom::Value, bool>
12951295
lookupProperty(
1296-
dom::Object const &data,
1296+
dom::Object const & context,
12971297
std::string_view path);
12981298

12991299
/// @copydoc lookupProperty
13001300
MRDOX_DECL
13011301
std::pair<dom::Value, bool>
13021302
lookupProperty(
1303-
dom::Value const& data,
1303+
dom::Value const& context,
13041304
dom::Value const& path);
13051305

13061306
/// @copydoc lookupProperty

0 commit comments

Comments
 (0)