Submitted By:            Bruce Dubbs <bdubbs@linuxfromscratch.org>
Date:                    2019-07-09
Initial Package Version: 5.1.0
Upstream Status:         In git repository
Origin:                  https://github.com/steveire/grantlee
Description:             Diff from git clone as of 2019-07-09.  Needed
                         for build with qt-5.13/gcc9/

diff -Naur grantlee-5.1.0/.clang-format grantlee/.clang-format
--- grantlee-5.1.0/.clang-format	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/.clang-format	2019-07-09 09:53:47.129091151 -0500
@@ -5,3 +5,4 @@
 Standard: Cpp11
 IndentWidth: 2
 BreakBeforeBraces: Linux
+FixNamespaceComments: false
diff -Naur grantlee-5.1.0/cmake/modules/Doxyfile.in grantlee/cmake/modules/Doxyfile.in
--- grantlee-5.1.0/cmake/modules/Doxyfile.in	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/cmake/modules/Doxyfile.in	2019-07-09 09:53:47.129091151 -0500
@@ -138,7 +138,8 @@
 HTML_FILE_EXTENSION    = .html
 HTML_HEADER            =
 HTML_FOOTER            =
-HTML_STYLESHEET        = @CMAKE_SOURCE_DIR@/dox/stylesheet.css
+HTML_STYLESHEET        =
+HTML_EXTRA_STYLESHEET  = @CMAKE_SOURCE_DIR@/dox/stylesheet.css
 HTML_ALIGN_MEMBERS     = YES
 GENERATE_HTMLHELP      = NO
 GENERATE_DOCSET        = NO
diff -Naur grantlee-5.1.0/CMakeLists.txt grantlee/CMakeLists.txt
--- grantlee-5.1.0/CMakeLists.txt	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/CMakeLists.txt	2019-07-09 09:53:47.129091151 -0500
@@ -20,7 +20,6 @@
 option( BUILD_TEXTDOCUMENT "Build the Grantlee textdocument library" TRUE )
 option( BUILD_MAIN_PLUGINS "Build the Grantlee Templates plugins" TRUE )
 option( BUILD_I18N_PLUGIN "Build the Grantlee Templates i18n plugin" TRUE )
-option( BUILD_SCRIPT_PLUGIN "Build the Grantlee Templates scriptable tags plugin" TRUE )
 option( BUILD_TESTS "Build the Grantlee tests" TRUE )
 
 if (BUILD_TESTS)
diff -Naur grantlee-5.1.0/dox/builtins.dox grantlee/dox/builtins.dox
--- grantlee-5.1.0/dox/builtins.dox	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/dox/builtins.dox	2019-07-09 09:53:47.129091151 -0500
@@ -6,7 +6,7 @@
 
   @section django_builtins Tags and filters ported from Django
 
-  See the <a href="http://docs.djangoproject.com/en/1.1/ref/templates/builtins/">Builtins documentation for Django 1.1</a> for an overview of the builtin tags and filters available in %Grantlee. Almost all tags and filter in django are available in %Grantlee. Exceptions are <a href="http://docs.djangoproject.com/en/1.1/ref/templates/builtins/#url">the url tag</a>, because %Grantlee does not have a views system. Additionally the ssi tag is disabled because of potential security risks. The dictdort, dictsortreversed, filesizeformat, iriencode, phone2numeric, pluralize, pprint, title, truncatewords_html, urlencode, urlize and urlizetrunc filters have not yet been ported due to time constraints.
+  See the <a href="https://docs.djangoproject.com/en/1.9/ref/templates/builtins/">Builtins documentation for Django 1.1</a> for an overview of the builtin tags and filters available in %Grantlee. Almost all tags and filter in django are available in %Grantlee. Exceptions are <a href="https://docs.djangoproject.com/en/1.9/ref/templates/builtins/#url">the url tag</a>, because %Grantlee does not have a views system. Additionally the ssi tag is disabled because of potential security risks. The dictdort, dictsortreversed, filesizeformat, iriencode, phone2numeric, pluralize, pprint, title, truncatewords_html, urlencode, urlize and urlizetrunc filters have not yet been ported due to time constraints.
 
   @section grantlee_extras Additional tags available in Grantlee
 
diff -Naur grantlee-5.1.0/dox/extension.dox grantlee/dox/extension.dox
--- grantlee-5.1.0/dox/extension.dox	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/dox/extension.dox	2019-07-09 09:53:47.131091112 -0500
@@ -96,38 +96,41 @@
   Here is an example of a @gr_tag{current_time} tag which displays the current time.
 
   @code
-    class CurrentTimeTag : public Grantlee::AbstractNodeFactory
+    class CurrentTimeNode : public Grantlee::Node
     {
-      Grantlee::Node *getNode(const QString &tagContent, Parser *p) const
-      {
-        // You almost always want to use smartSplit.
-        QStringList parts = smartSplit(tagContent);
-        parts.removeFirst(); // Not interested in the name of the tag.
-
-        if (!parts.isEmpty())
-          // The remaining parts are the arguments to the tag. If an incorrect number of arguments
-          // is supplied, and exception should be thrown.
-          throw Grantlee::Exception( TagSyntaxError, "current_time does not take any arguments" );
+          Q_OBJECT
 
-        return new CurrentTimeNode();
-      }
+       public:
+          CurrentTimeNode( QObject *parent = nullptr )
+             : Grantlee::Node( parent )
+          {
+          }
+
+          virtual void render( Grantlee::OutputStream *stream, Grantlee::Context *c) const override
+          {
+             Q_UNUSED(c);
+             
+             (*stream) <<  QDateTime::currentDateTime().toString();
+          }
     };
 
-    class CurrentTimeNode : public Grantlee::Node
+    class CurrentTimeTagFactory : public Grantlee::AbstractNodeFactory
     {
-      Q_OBJECT
-    public:
-      CurrentTimeNode(QObject *parent)
-        : QObject(parent)
-      {
-
-      }
-
-      void render( Grantlee::OutputStream *stream, Context *c) const
-      {
-        Q_UNUSED(c);
-        return QDateTime::currentDateTime().toString();
-      }
+          Grantlee::Node *getNode(const QString &tagContent, Grantlee::Parser *p) const override
+          {
+             Q_UNUSED(p);
+
+             // You almost always want to use smartSplit.
+             QStringList parts = smartSplit(tagContent);
+             parts.removeFirst(); // Not interested in the name of the tag.
+
+             if (!parts.isEmpty())
+                // The remaining parts are the arguments to the tag. If an incorrect number of arguments
+                // is supplied, and exception should be thrown.
+                throw Grantlee::Exception( Grantlee::TagSyntaxError, "current_time does not take any arguments" );
+
+             return new CurrentTimeNode();
+          }
     };
   @endcode
 
diff -Naur grantlee-5.1.0/dox/for_app_dev.dox grantlee/dox/for_app_dev.dox
--- grantlee-5.1.0/dox/for_app_dev.dox	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/dox/for_app_dev.dox	2019-07-09 09:53:47.131091112 -0500
@@ -246,13 +246,6 @@
     private:
       QList<QObject*> m_friends;
     };
-    Q_DECLARE_METATYPE(QList<QObject*>)
-  @endcode
-
-  It is also necessary to register QList<QObject*> with the Qt metatype system and with Grantlee
-
-  @code
-    Grantlee::registerSequentialContainer<QList<QObject*> >();
   @endcode
 
   @subsection generic_variables
diff -Naur grantlee-5.1.0/dox/for_themers.dox grantlee/dox/for_themers.dox
--- grantlee-5.1.0/dox/for_themers.dox	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/dox/for_themers.dox	2019-07-09 09:53:47.131091112 -0500
@@ -344,7 +344,7 @@
 
   would not escape the content between the autoescape and endautoescape tags. This should only be used for content which is actually already safe.
 
-  @see http://docs.djangoproject.com/en/1.1/topics/templates/#for-individual-variables
+  @see https://docs.djangoproject.com/en/1.9/ref/templates/language/#for-individual-variables
 
   @subsection extending_syntax Extending the syntax
 
diff -Naur grantlee-5.1.0/dox/generictypes.dox grantlee/dox/generictypes.dox
--- grantlee-5.1.0/dox/generictypes.dox	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/dox/generictypes.dox	2019-07-09 09:53:47.131091112 -0500
@@ -244,7 +244,7 @@
     }
   @endcode
 
-  @see <a href="http://docs.djangoproject.com/en/1.1/ref/templates/builtins/#regroup">The regroup tag</a>
+  @see <a href="http://docs.djangoproject.com/en/1.9/ref/templates/builtins/#regroup">The regroup tag</a>
 
   The output would be something like
 
diff -Naur grantlee-5.1.0/dox/using_and_deploying.dox grantlee/dox/using_and_deploying.dox
--- grantlee-5.1.0/dox/using_and_deploying.dox	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/dox/using_and_deploying.dox	2019-07-09 09:53:47.134091053 -0500
@@ -204,14 +204,14 @@
 
   @code
     mkdir build && cd build
-    cmake .. -DBUILD_GUI:BOOL=OFF -DBUILD_TESTS:BOOL=OFF -DBUILD_SCRIPT_PLUGIN:BOOL=OFF
+    cmake .. -DBUILD_GUI:BOOL=OFF -DBUILD_TESTS:BOOL=OFF
   @endcode
 
   Similarly, it is possible to build only grantlee_gui standalone
 
   @code
     mkdir build && cd build
-    cmake .. -DBUILD_CORE:BOOL=OFF -DBUILD_TESTS:BOOL=OFF -DBUILD_MAIN_PLUGINS:BOOL=OFF -DBUILD_SCRIPT_PLUGIN:BOOL=OFF
+    cmake .. -DBUILD_CORE:BOOL=OFF -DBUILD_TESTS:BOOL=OFF -DBUILD_MAIN_PLUGINS:BOOL=OFF
   @endcode
 
 */
diff -Naur grantlee-5.1.0/examples/contacts/contact.h grantlee/examples/contacts/contact.h
--- grantlee-5.1.0/examples/contacts/contact.h	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/examples/contacts/contact.h	2019-07-09 09:53:47.136091014 -0500
@@ -111,8 +111,4 @@
   QList<QObject *> m_friends;
 };
 
-Q_DECLARE_METATYPE(Contact *)
-Q_DECLARE_METATYPE(QList<Contact *>)
-Q_DECLARE_METATYPE(QList<QObject *>)
-
 #endif
diff -Naur grantlee-5.1.0/scripts/fix-clang-format.py grantlee/scripts/fix-clang-format.py
--- grantlee-5.1.0/scripts/fix-clang-format.py	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/scripts/fix-clang-format.py	2019-07-09 09:53:47.140090935 -0500
@@ -2,98 +2,4 @@
 
 import os
 
-handle = os.popen("for f in `git ls-files textdocument/*.cpp textdocument/*.h templates/*.cpp templates/*.h`; do clang-format-3.8 $f -i -style=file;  done;")
-
-handle = os.popen("""/usr/bin/git grep -l QStri""" + """ngLiteral""", "r")
-
-lines = handle.read().splitlines()
-
-def fixClangFormat(input):
-
-  output = ""
-
-  start = 0
-
-  while start < len(input):
-    found = input.find("QStri" + "ngLiteral(", start)
-    if (found < 0):
-      break
-    beg = found + len("QStrin" + "gLiteral(")
-
-    quoteLoc = input.find("\"", beg)
-    closeLoc = input.find(")", beg)
-    if (quoteLoc < 0 or closeLoc < quoteLoc):
-      output += input[start:closeLoc]
-      start = closeLoc
-      continue
-
-    output += input[start:beg]
-
-    numFragments = 0
-    origCloseLoc = closeLoc
-    origQuoteLoc = quoteLoc
-
-    quoteLocStart = beg
-    while closeLoc > quoteLoc:
-      numFragments += 1
-      endQuoteLoc = input.find("\"", quoteLoc + 1)
-      while True:
-        numEscapes = 0
-        escStart = endQuoteLoc - 1
-        while(input[escStart] == "\\"):
-          numEscapes += 1
-          escStart -= 1
-        if (numEscapes % 2 != 0):
-          endQuoteLoc = input.find("\"", endQuoteLoc + 1)
-        else:
-          break
-
-      closeLoc = input.find(")", endQuoteLoc + 1)
-      quoteLoc = input.find("\"", endQuoteLoc + 1)
-      if (quoteLoc < 0):
-        break
-
-    if (numFragments == 1):
-      output += input[beg:closeLoc]
-      start = closeLoc
-      continue
-
-    output += "\""
-
-    closeLoc = origCloseLoc
-    quoteLoc = origQuoteLoc
-
-    quoteLocStart = beg
-    while closeLoc > quoteLoc:
-      endQuoteLoc = input.find("\"", quoteLoc + 1)
-      while True:
-        numEscapes = 0
-        escStart = endQuoteLoc - 1
-        while(input[escStart] == "\\"):
-          numEscapes += 1
-          escStart -= 1
-        if (numEscapes % 2 != 0):
-          endQuoteLoc = input.find("\"", endQuoteLoc + 1)
-        else:
-          break
-
-      output += input[quoteLoc + 1:endQuoteLoc]
-
-      closeLoc = input.find(")", endQuoteLoc + 1)
-      quoteLoc = input.find("\"", endQuoteLoc + 1)
-      if (quoteLoc < 0 or closeLoc < quoteLoc):
-        output += "\""
-      if (quoteLoc < 0):
-        break
-
-    start = closeLoc
-
-  output += input[start:]
-
-  return output
-
-for line in lines:
-  f = open(line)
-  all = fixClangFormat(f.read())
-  f = open(line, "w")
-  f.write(all)
+handle = os.popen("for f in `git ls-files textdocument/*.cpp textdocument/*.h templates/*.cpp templates/*.h`; do clang-format $f -i -style=file;  done;")
diff -Naur grantlee-5.1.0/templates/CMakeLists.txt grantlee/templates/CMakeLists.txt
--- grantlee-5.1.0/templates/CMakeLists.txt	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/CMakeLists.txt	2019-07-09 09:53:47.140090935 -0500
@@ -1,6 +1,6 @@
 
 find_package(Qt5Core 5.2.0 REQUIRED)
-find_package(Qt5Script 5.2.0)
+find_package(Qt5Qml 5.2.0)
 
 add_subdirectory(lib)
 
@@ -16,11 +16,6 @@
   add_subdirectory(i18n)
 endif()
 
-
-if (BUILD_SCRIPT_PLUGIN)
-#  add_subdirectory(scriptabletags)
-endif()
-
 if (BUILD_TESTS)
   add_subdirectory(tests)
 endif()
diff -Naur grantlee-5.1.0/templates/defaultfilters/datetime.cpp grantlee/templates/defaultfilters/datetime.cpp
--- grantlee-5.1.0/templates/defaultfilters/datetime.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/defaultfilters/datetime.cpp	2019-07-09 09:53:47.140090935 -0500
@@ -84,20 +84,12 @@
   return firstChunk;
 }
 
-QVariant timeUntil(const QDateTime &dt, QDateTime now = QDateTime())
-{
-  if (!now.isValid())
-    now = QDateTime::currentDateTime();
-
-  return timeSince(now, dt);
-}
-
 QVariant DateFilter::doFilter(const QVariant &input, const QVariant &argument,
                               bool autoescape) const
 {
   Q_UNUSED(autoescape)
   auto d = QDateTime::fromString(getSafeString(input),
-                                 QStringLiteral("yyyy-MM-ddThh:mm:ss"));
+                                 QStringLiteral("yyyy-MM-ddThh:mm:ss.zzz"));
 
   auto argString = getSafeString(argument);
 
@@ -128,7 +120,10 @@
   else
     late = argument.value<QDateTime>();
 
-  return timeSince(input.value<QDateTime>(), late);
+  auto early = input.value<QDateTime>();
+  if (!early.isValid())
+    return QVariant();
+  return timeSince(early, late);
 }
 
 QVariant TimeUntilFilter::doFilter(const QVariant &input,
@@ -142,5 +137,8 @@
   else
     early = argument.value<QDateTime>();
 
-  return timeSince(early, input.value<QDateTime>());
+  auto late = input.value<QDateTime>();
+  if (!late.isValid())
+    return QVariant();
+  return timeSince(early, late);
 }
diff -Naur grantlee-5.1.0/templates/defaultfilters/lists.cpp grantlee/templates/defaultfilters/lists.cpp
--- grantlee-5.1.0/templates/defaultfilters/lists.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/defaultfilters/lists.cpp	2019-07-09 09:53:47.141090916 -0500
@@ -135,6 +135,9 @@
 
   auto varList = input.value<QVariantList>();
 
+  if (varList.isEmpty())
+    return QVariant();
+
   qsrand(QDateTime::currentDateTimeUtc().toTime_t());
   auto rnd = qrand() % varList.size();
   return varList.at(rnd);
@@ -147,6 +150,9 @@
   auto argString = getSafeString(argument);
   auto splitterIndex = argString.get().indexOf(QLatin1Char(':'));
   QString inputString = getSafeString(input);
+  if (inputString.isEmpty())
+    return QVariant();
+
   if (splitterIndex >= 0) {
     auto left = argString.get().left(splitterIndex).get().toInt();
     auto right = argString.get().right(splitterIndex).get().toInt();
diff -Naur grantlee-5.1.0/templates/defaultfilters/lists.h grantlee/templates/defaultfilters/lists.h
--- grantlee-5.1.0/templates/defaultfilters/lists.h	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/defaultfilters/lists.h	2019-07-09 09:53:47.141090916 -0500
@@ -111,6 +111,7 @@
                     bool autoescape = false) const override;
 
   bool isSafe() const override { return true; }
+
 protected:
   SafeString processList(const QVariantList &list, int tabs,
                          bool autoescape) const;
diff -Naur grantlee-5.1.0/templates/defaultfilters/stringfilters.cpp grantlee/templates/defaultfilters/stringfilters.cpp
--- grantlee-5.1.0/templates/defaultfilters/stringfilters.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/defaultfilters/stringfilters.cpp	2019-07-09 09:53:47.141090916 -0500
@@ -53,7 +53,7 @@
 
   return QVariant(safeString.get().at(0).toUpper()
                   + static_cast<QString>(
-                        safeString.get().right(safeString.get().size() - 1)));
+                      safeString.get().right(safeString.get().size() - 1)));
 }
 
 EscapeJsFilter::EscapeJsFilter() {}
@@ -352,6 +352,8 @@
   QString _input = getSafeString(input);
   auto width = argument.value<int>();
   auto partList = _input.split(QLatin1Char(' '), QString::SkipEmptyParts);
+  if (partList.isEmpty())
+    return QVariant();
   auto output = partList.takeFirst();
   auto pos = output.size() - output.lastIndexOf(QLatin1Char('\n')) - 1;
   Q_FOREACH (const QString &part, partList) {
diff -Naur grantlee-5.1.0/templates/defaulttags/if.cpp grantlee/templates/defaulttags/if.cpp
--- grantlee-5.1.0/templates/defaulttags/if.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/defaulttags/if.cpp	2019-07-09 09:53:47.142090896 -0500
@@ -77,8 +77,7 @@
 IfNode::IfNode(QObject *parent) : Node(parent) {}
 
 void IfNode::setNodelistConditions(
-    const QVector<QPair<QSharedPointer<IfToken>, NodeList>>
-        &conditionNodelists)
+    const QVector<QPair<QSharedPointer<IfToken>, NodeList>> &conditionNodelists)
 {
   mConditionNodelists = conditionNodelists;
 }
@@ -93,7 +92,7 @@
     if (pair.first) {
       try {
         match = Grantlee::variantIsTrue(pair.first->evaluate(c));
-      } catch (Grantlee::Exception) {
+      } catch (const Grantlee::Exception &) {
       }
     } else {
       match = true;
diff -Naur grantlee-5.1.0/templates/defaulttags/if_p.h grantlee/templates/defaulttags/if_p.h
--- grantlee-5.1.0/templates/defaulttags/if_p.h	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/defaulttags/if_p.h	2019-07-09 09:53:47.142090896 -0500
@@ -104,8 +104,7 @@
     return QSharedPointer<IfToken>::create(0, QString(), Sentinal);
   }
 
-  using ArgsType
-      = std::pair<QSharedPointer<IfToken>, QSharedPointer<IfToken>>;
+  using ArgsType = std::pair<QSharedPointer<IfToken>, QSharedPointer<IfToken>>;
 
   IfToken(int lbp, const QString &tokenName, OpCode opCode) : mArgs()
   {
@@ -305,9 +304,11 @@
     case NotInCode:
       return !contains(mArgs.first->evaluate(c), mArgs.second->evaluate(c));
     case EqCode:
-      return Grantlee::equals(mArgs.first->evaluate(c), mArgs.second->evaluate(c));
+      return Grantlee::equals(mArgs.first->evaluate(c),
+                              mArgs.second->evaluate(c));
     case NeqCode:
-      return !Grantlee::equals(mArgs.first->evaluate(c), mArgs.second->evaluate(c));
+      return !Grantlee::equals(mArgs.first->evaluate(c),
+                               mArgs.second->evaluate(c));
     case GtCode:
       return mArgs.first->evaluate(c) > mArgs.second->evaluate(c);
     case GteCode:
@@ -320,7 +321,7 @@
       Q_ASSERT(!"Invalid OpCode");
       return QVariant();
     }
-  } catch (Grantlee::Exception) {
+  } catch (const Grantlee::Exception &) {
     return false;
   }
 }
diff -Naur grantlee-5.1.0/templates/lib/CMakeLists.txt grantlee/templates/lib/CMakeLists.txt
--- grantlee-5.1.0/templates/lib/CMakeLists.txt	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/lib/CMakeLists.txt	2019-07-09 09:53:47.143090876 -0500
@@ -88,7 +88,7 @@
     PLUGINS_PREFER_DEBUG_POSTFIX=$<CONFIG:Debug>
 )
 
-if (Qt5Script_FOUND)
+if (Qt5Qml_FOUND)
   set(scriptabletags_FILES
     scriptablecontext.cpp
     scriptablefilterexpression.cpp
@@ -108,7 +108,7 @@
   target_sources(Grantlee_Templates PRIVATE ${scriptabletags_SRCS})
   target_include_directories(Grantlee_Templates PRIVATE ../scriptabletags)
   target_link_libraries(Grantlee_Templates
-    LINK_PRIVATE Qt5::Script
+    LINK_PRIVATE Qt5::Qml
   )
 endif()
 
@@ -118,10 +118,6 @@
 
 configure_file(grantlee_test_export.h.in "${CMAKE_CURRENT_BINARY_DIR}/grantlee_test_export.h")
 
-file(READ "${CMAKE_CURRENT_BINARY_DIR}/grantlee_test_export.h" _content)
-
-file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/grantlee_templates_export.h" "${_content}")
-
 target_link_libraries(Grantlee_Templates
   LINK_PUBLIC Qt5::Core
 )
diff -Naur grantlee-5.1.0/templates/lib/customtyperegistry.cpp grantlee/templates/lib/customtyperegistry.cpp
--- grantlee-5.1.0/templates/lib/customtyperegistry.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/lib/customtyperegistry.cpp	2019-07-09 09:53:47.143090876 -0500
@@ -57,16 +57,16 @@
 
   {
     if (!types.contains(id)) {
-      qCWarning(GRANTLEE_CUSTOMTYPE) << "Don't know how to handle metatype"
-                                     << QMetaType::typeName(id);
+      qCWarning(GRANTLEE_CUSTOMTYPE)
+          << "Don't know how to handle metatype" << QMetaType::typeName(id);
       // :TODO: Print out error message
       return QVariant();
     }
 
     const CustomTypeInfo &info = types[id];
     if (!info.lookupFunction) {
-      qCWarning(GRANTLEE_CUSTOMTYPE) << "No lookup function for metatype"
-                                     << QMetaType::typeName(id);
+      qCWarning(GRANTLEE_CUSTOMTYPE)
+          << "No lookup function for metatype" << QMetaType::typeName(id);
       lf = 0;
       // :TODO: Print out error message
       return QVariant();
diff -Naur grantlee-5.1.0/templates/lib/engine.cpp grantlee/templates/lib/engine.cpp
--- grantlee-5.1.0/templates/lib/engine.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/lib/engine.cpp	2019-07-09 09:53:47.143090876 -0500
@@ -24,7 +24,7 @@
 #include "exception.h"
 #include "grantlee_config_p.h"
 #include "grantlee_version.h"
-#ifdef QT_SCRIPT_LIB
+#ifdef QT_QML_LIB
 #include "scriptabletags.h"
 #endif
 #include "template_p.h"
@@ -52,7 +52,7 @@
 
 Engine::~Engine()
 {
-#ifdef QT_SCRIPT_LIB
+#ifdef QT_QML_LIB
   qDeleteAll(d_ptr->m_scriptableLibraries);
 #endif
   d_ptr->m_libraries.clear();
@@ -142,7 +142,7 @@
 {
   Q_D(Engine);
 
-#ifdef QT_SCRIPT_LIB
+#ifdef QT_QML_LIB
   // Make sure we can load default scriptable libraries if we're supposed to.
   if (d->m_defaultLibraries.contains(QLatin1String(__scriptableLibName))
       && !d->m_scriptableTagLibrary) {
@@ -196,7 +196,7 @@
     // that.
     uint minorVersion = GRANTLEE_VERSION_MINOR;
     while (acceptableVersion<GRANTLEE_MIN_PLUGIN_VERSION>(minorVersion)) {
-#ifdef QT_SCRIPT_LIB
+#ifdef QT_QML_LIB
       // Although we don't use scripted libaries here, we need to
       // recognize them
       // being first
@@ -224,7 +224,7 @@
 {
   Q_D(Engine);
 
-#ifdef QT_SCRIPT_LIB
+#ifdef QT_QML_LIB
   if (name == QLatin1String(__scriptableLibName))
     return 0;
 #endif
@@ -251,7 +251,7 @@
 TagLibraryInterface *EnginePrivate::loadLibrary(const QString &name,
                                                 uint minorVersion)
 {
-#ifdef QT_SCRIPT_LIB
+#ifdef QT_QML_LIB
   auto scriptableLibrary = loadScriptableLibrary(name, minorVersion);
   if (scriptableLibrary)
     return scriptableLibrary;
@@ -264,7 +264,7 @@
 
 EnginePrivate::EnginePrivate(Engine *engine)
     : q_ptr(engine)
-#ifdef QT_SCRIPT_LIB
+#ifdef QT_QML_LIB
       ,
       m_scriptableTagLibrary(0)
 #endif
@@ -301,7 +301,7 @@
   return QString();
 }
 
-#ifdef QT_SCRIPT_LIB
+#ifdef QT_QML_LIB
 ScriptableLibraryContainer *
 EnginePrivate::loadScriptableLibrary(const QString &name, uint minorVersion)
 {
diff -Naur grantlee-5.1.0/templates/lib/engine_p.h grantlee/templates/lib/engine_p.h
--- grantlee-5.1.0/templates/lib/engine_p.h	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/lib/engine_p.h	2019-07-09 09:53:47.144090856 -0500
@@ -86,7 +86,7 @@
 
   TagLibraryInterface *loadLibrary(const QString &name, uint minorVersion);
   QString getScriptLibraryName(const QString &name, uint minorVersion) const;
-#ifdef QT_SCRIPT_LIB
+#ifdef QT_QML_LIB
   ScriptableLibraryContainer *loadScriptableLibrary(const QString &name,
                                                     uint minorVersion);
 #endif
@@ -97,14 +97,14 @@
   Engine *const q_ptr;
 
   QHash<QString, PluginPointer<TagLibraryInterface>> m_libraries;
-#ifdef QT_SCRIPT_LIB
+#ifdef QT_QML_LIB
   QHash<QString, ScriptableLibraryContainer *> m_scriptableLibraries;
 #endif
 
   QList<QSharedPointer<AbstractTemplateLoader>> m_loaders;
   QStringList m_pluginDirs;
   QStringList m_defaultLibraries;
-#ifdef QT_SCRIPT_LIB
+#ifdef QT_QML_LIB
   ScriptableTagLibrary *m_scriptableTagLibrary;
 #endif
   bool m_smartTrimEnabled;
diff -Naur grantlee-5.1.0/templates/lib/grantlee_test_export.h.in grantlee/templates/lib/grantlee_test_export.h.in
--- grantlee-5.1.0/templates/lib/grantlee_test_export.h.in	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/lib/grantlee_test_export.h.in	2019-07-09 09:53:47.144090856 -0500
@@ -1,2 +1,8 @@
+#ifndef GRANTLEE_TEST_EXPORT_H
+#define GRANTLEE_TEST_EXPORT_H
+
+#include "grantlee_templates_export.h"
 
 #define GRANTLEE_TESTS_EXPORT @GRANTLEE_TESTS_EXPORT@
+
+#endif
diff -Naur grantlee-5.1.0/templates/lib/lexer.cpp grantlee/templates/lib/lexer.cpp
--- grantlee-5.1.0/templates/lib/lexer.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/lib/lexer.cpp	2019-07-09 09:53:47.144090856 -0500
@@ -46,23 +46,23 @@
 typedef CharacterTransition<'}', MarkEndSyntax> EndTemplateSyntaxHandler;
 typedef NegateCharacterTransition<'}'> NotEndTemplateSyntaxHandler;
 
-typedef LexerObject<TextProcessingTransition,
-                    Negate<OrTest<CharacterTest<'{'>,
-                                  OrTest<CharacterTest<'#'>,
-                                         CharacterTest<'%'>>>>>
+typedef LexerObject<
+    TextProcessingTransition,
+    Negate<OrTest<CharacterTest<'{'>,
+                  OrTest<CharacterTest<'#'>, CharacterTest<'%'>>>>>
     NotBeginTemplateSyntaxHandler;
 
-typedef LexerObject<TextProcessingTransition,
-                    Negate<OrTest<CharacterTest<'{'>,
-                                  OrTest<CharacterTest<'#'>,
-                                         OrTest<CharacterTest<'%'>,
-                                                CharacterTest<'\n'>>>>>>
+typedef LexerObject<
+    TextProcessingTransition,
+    Negate<OrTest<CharacterTest<'{'>,
+                  OrTest<CharacterTest<'#'>,
+                         OrTest<CharacterTest<'%'>, CharacterTest<'\n'>>>>>>
     NotBeginTemplateSyntaxOrNewlineHandler;
 
-typedef LexerObject<TextProcessingTransition,
-                    Negate<OrTest<CharacterTest<'#'>,
-                                  OrTest<CharacterTest<'%'>,
-                                         CharacterTest<'\n'>>>>>
+typedef LexerObject<
+    TextProcessingTransition,
+    Negate<OrTest<CharacterTest<'#'>,
+                  OrTest<CharacterTest<'%'>, CharacterTest<'\n'>>>>>
     NotTagCommentOrNewlineHandler;
 
 typedef LexerObject<TextProcessingTransition,
diff -Naur grantlee-5.1.0/templates/lib/lexer_p.h grantlee/templates/lib/lexer_p.h
--- grantlee-5.1.0/templates/lib/lexer_p.h	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/lib/lexer_p.h	2019-07-09 09:53:47.144090856 -0500
@@ -24,7 +24,7 @@
 #include "textprocessingmachine_p.h"
 #include "token.h"
 
-template <typename T> class QList;
+#include <QList>
 
 namespace Grantlee
 {
@@ -86,6 +86,7 @@
   void onEntry() { return Action1::doAction(m_lexer); }
 
   void onExit() { return Action2::doAction(m_lexer); }
+
 private:
   Lexer *const m_lexer;
 };
diff -Naur grantlee-5.1.0/templates/lib/nulllocalizer_p.h grantlee/templates/lib/nulllocalizer_p.h
--- grantlee-5.1.0/templates/lib/nulllocalizer_p.h	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/lib/nulllocalizer_p.h	2019-07-09 09:53:47.144090856 -0500
@@ -21,6 +21,8 @@
 #ifndef GRANTLEE_NULLLOCALIZER_P_H
 #define GRANTLEE_NULLLOCALIZER_P_H
 
+#include "grantlee_test_export.h"
+
 #include "abstractlocalizer.h"
 
 namespace Grantlee
diff -Naur grantlee-5.1.0/templates/lib/parser.cpp grantlee/templates/lib/parser.cpp
--- grantlee-5.1.0/templates/lib/parser.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/lib/parser.cpp	2019-07-09 09:53:47.145090837 -0500
@@ -205,7 +205,7 @@
       FilterExpression filterExpression;
       try {
         filterExpression = FilterExpression(token.content, q);
-      } catch (Grantlee::Exception e) {
+      } catch (const Grantlee::Exception &e) {
         throw Grantlee::Exception(e.errorCode(),
                                   QStringLiteral("%1, line %2, %3")
                                       .arg(e.what())
@@ -247,7 +247,7 @@
       Node *n;
       try {
         n = nodeFactory->getNode(token.content, q);
-      } catch (Grantlee::Exception e) {
+      } catch (const Grantlee::Exception &e) {
         throw Grantlee::Exception(e.errorCode(),
                                   QStringLiteral("%1, line %2, %3")
                                       .arg(e.what())
@@ -310,7 +310,8 @@
   } else {
     throw Grantlee::Exception(
         InvalidBlockTagError,
-        QStringLiteral("Invalid block tag on line %1: '%2\''. Did you forget to register or load this tag?")
+        QStringLiteral("Invalid block tag on line %1: '%2\''. Did you forget "
+                       "to register or load this tag?")
             .arg(token.linenumber)
             .arg(command));
   }
diff -Naur grantlee-5.1.0/templates/lib/templateloader.cpp grantlee/templates/lib/templateloader.cpp
--- grantlee-5.1.0/templates/lib/templateloader.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/lib/templateloader.cpp	2019-07-09 09:53:47.145090837 -0500
@@ -39,8 +39,9 @@
   FileSystemTemplateLoaderPrivate(FileSystemTemplateLoader *loader,
                                   QSharedPointer<AbstractLocalizer> localizer)
       : q_ptr(loader),
-        m_localizer(localizer ? localizer : QSharedPointer<AbstractLocalizer>(
-                                                new NullLocalizer))
+        m_localizer(localizer
+                        ? localizer
+                        : QSharedPointer<AbstractLocalizer>(new NullLocalizer))
   {
   }
   Q_DECLARE_PUBLIC(FileSystemTemplateLoader)
@@ -143,7 +144,7 @@
 
     if (file.exists()
         && !fi.canonicalFilePath().contains(
-               QDir(d->m_templateDirs.at(i)).canonicalPath()))
+            QDir(d->m_templateDirs.at(i)).canonicalPath()))
       return Template();
     ++i;
   }
diff -Naur grantlee-5.1.0/templates/lib/variable.cpp grantlee/templates/lib/variable.cpp
--- grantlee-5.1.0/templates/lib/variable.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/lib/variable.cpp	2019-07-09 09:53:47.146090817 -0500
@@ -172,6 +172,9 @@
     auto i = 0;
     if (d->m_lookups.at(i) == QStringLiteral("Qt")) {
       ++i;
+      if (d->m_lookups.size() <= i)
+        return QVariant();
+
       const auto nextPart = d->m_lookups.at(i);
       ++i;
 
diff -Naur grantlee-5.1.0/templates/scriptabletags/CMakeLists.txt grantlee/templates/scriptabletags/CMakeLists.txt
--- grantlee-5.1.0/templates/scriptabletags/CMakeLists.txt	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/CMakeLists.txt	1969-12-31 18:00:00.000000000 -0600
@@ -1,23 +0,0 @@
-project(grantlee_scriptabletags)
-
-add_library(grantlee_scriptabletags MODULE
-  scriptablecontext.cpp
-  scriptablefilterexpression.cpp
-  scriptablenode.cpp
-  scriptableparser.cpp
-  scriptablesafestring.cpp
-  scriptabletags.cpp
-  scriptabletemplate.cpp
-  scriptablevariable.cpp
-  scriptablefilter.cpp
-)
-grantlee_adjust_plugin_name(grantlee_scriptabletags)
-
-target_link_libraries(grantlee_scriptabletags
-  Grantlee5::Templates
-  Qt4::QtScript
-)
-
-install(TARGETS grantlee_scriptabletags
-         LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR}
-)
diff -Naur grantlee-5.1.0/templates/scriptabletags/scriptablecontext.cpp grantlee/templates/scriptabletags/scriptablecontext.cpp
--- grantlee-5.1.0/templates/scriptabletags/scriptablecontext.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/scriptablecontext.cpp	2019-07-09 09:53:47.146090817 -0500
@@ -42,7 +42,7 @@
 
 void ScriptableContext::pop() { m_c->pop(); }
 
-QString ScriptableContext::render(const QObjectList &list) const
+QString ScriptableContext::render(const QList<QObject *> &list) const
 {
   NodeList nodeList;
   QListIterator<QObject *> it(list);
diff -Naur grantlee-5.1.0/templates/scriptabletags/scriptablecontext.h grantlee/templates/scriptabletags/scriptablecontext.h
--- grantlee-5.1.0/templates/scriptabletags/scriptablecontext.h	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/scriptablecontext.h	2019-07-09 09:53:47.146090817 -0500
@@ -45,7 +45,7 @@
   void push();
   void pop();
 
-  QString render(const QObjectList &list) const;
+  QString render(const QList<QObject *> &list) const;
 
 private:
   Context *m_c;
diff -Naur grantlee-5.1.0/templates/scriptabletags/scriptablefilter.cpp grantlee/templates/scriptabletags/scriptablefilter.cpp
--- grantlee-5.1.0/templates/scriptabletags/scriptablefilter.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/scriptablefilter.cpp	2019-07-09 09:53:47.146090817 -0500
@@ -23,10 +23,10 @@
 
 #include "util.h"
 
-#include <QtScript/QScriptEngine>
+#include <QtQml/QJSEngine>
 
-ScriptableFilter::ScriptableFilter(const QScriptValue &filterObject,
-                                   QScriptEngine *engine)
+ScriptableFilter::ScriptableFilter(const QJSValue &filterObject,
+                                   QJSEngine *engine)
     : m_filterObject(filterObject), m_scriptEngine(engine)
 {
 }
@@ -47,7 +47,7 @@
                                     bool autoescape) const
 {
   Q_UNUSED(autoescape)
-  QScriptValueList args;
+  QJSValueList args;
   if (input.userType() == qMetaTypeId<QVariantList>()) {
     auto inputList = input.value<QVariantList>();
     auto array = m_scriptEngine->newArray(inputList.size());
@@ -56,7 +56,7 @@
         array.setProperty(
             i, m_scriptEngine->newQObject(inputList.at(i).value<QObject *>()));
       } else {
-        array.setProperty(i, m_scriptEngine->newVariant(inputList.at(i)));
+        array.setProperty(i, m_scriptEngine->toScriptValue(inputList.at(i)));
       }
     }
     args << array;
@@ -68,7 +68,7 @@
     } else if (input.canConvert<QObject *>()) {
       args << m_scriptEngine->newQObject(input.value<QObject *>());
     } else {
-      args << m_scriptEngine->newVariant(input);
+      args << m_scriptEngine->toScriptValue(input);
     }
   }
 
@@ -77,15 +77,15 @@
     ssObj->setContent(getSafeString(argument));
     args << m_scriptEngine->newQObject(ssObj);
   } else {
-    args << m_scriptEngine->newVariant(argument);
+    args << m_scriptEngine->toScriptValue(argument);
   }
   auto filterObject = m_filterObject;
-  auto returnValue = filterObject.call(QScriptValue(), args);
+  auto returnValue = filterObject.call(args);
 
   if (returnValue.isString()) {
     return getSafeString(returnValue.toString());
   } else if (returnValue.isQObject()) {
-    auto returnedObject = qscriptvalue_cast<QObject *>(returnValue);
+    auto returnedObject = qjsvalue_cast<QObject *>(returnValue);
     auto returnedStringObject
         = qobject_cast<ScriptableSafeString *>(returnedObject);
     if (!returnedStringObject)
@@ -93,9 +93,9 @@
     auto returnedString = returnedStringObject->wrappedString();
     return returnedString;
   } else if (returnValue.isVariant()) {
-    return qscriptvalue_cast<QVariant>(returnValue);
+    return qjsvalue_cast<QVariant>(returnValue);
   } else if (returnValue.isArray()) {
-    return qscriptvalue_cast<QVariantList>(returnValue);
+    return qjsvalue_cast<QVariantList>(returnValue);
   }
   return QVariant();
 }
diff -Naur grantlee-5.1.0/templates/scriptabletags/scriptablefilterexpression.cpp grantlee/templates/scriptabletags/scriptablefilterexpression.cpp
--- grantlee-5.1.0/templates/scriptabletags/scriptablefilterexpression.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/scriptablefilterexpression.cpp	2019-07-09 09:53:47.146090817 -0500
@@ -20,36 +20,20 @@
 
 #include "scriptablefilterexpression.h"
 
-#include <QtScript/QScriptEngine>
+#include <QtQml/QJSEngine>
 
 #include "parser.h"
-#include "scriptablecontext.h"
 #include "scriptablesafestring.h"
 #include "util.h"
 
 using namespace Grantlee;
 
-Q_SCRIPT_DECLARE_QMETAOBJECT(ScriptableFilterExpression, QObject *)
-
-QScriptValue ScriptableFilterExpressionConstructor(QScriptContext *context,
-                                                   QScriptEngine *engine)
-{
-  auto object = new ScriptableFilterExpression(engine);
-
-  auto parserObj = context->argument(1).toQObject();
-  auto p = qobject_cast<Parser *>(parserObj);
-
-  object->init(context->argument(0).toString(), p);
-
-  return engine->newQObject(object);
-}
-
 ScriptableFilterExpression::ScriptableFilterExpression(QObject *parent)
     : QObject(parent), m_engine(0)
 {
 }
 
-ScriptableFilterExpression::ScriptableFilterExpression(QScriptEngine *engine,
+ScriptableFilterExpression::ScriptableFilterExpression(QJSEngine *engine,
                                                        QObject *parent)
     : QObject(parent), m_engine(engine)
 {
diff -Naur grantlee-5.1.0/templates/scriptabletags/scriptablefilterexpression.h grantlee/templates/scriptabletags/scriptablefilterexpression.h
--- grantlee-5.1.0/templates/scriptabletags/scriptablefilterexpression.h	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/scriptablefilterexpression.h	2019-07-09 09:53:47.146090817 -0500
@@ -23,23 +23,17 @@
 
 #include <QtCore/QObject>
 
-#include <QtScript/QScriptValue>
+#include <QtQml/QJSValue>
 
 #include "filterexpression.h"
-
-class QScriptContext;
-
-class ScriptableContext;
-
-QScriptValue ScriptableFilterExpressionConstructor(QScriptContext *context,
-                                                   QScriptEngine *engine);
+#include "scriptablecontext.h"
 
 class ScriptableFilterExpression : public QObject
 {
   Q_OBJECT
 public:
   ScriptableFilterExpression(QObject *parent = 0);
-  ScriptableFilterExpression(QScriptEngine *engine, QObject *parent = 0);
+  ScriptableFilterExpression(QJSEngine *engine, QObject *parent = 0);
 
   void init(const QString &content, Grantlee::Parser *parser);
 
@@ -51,11 +45,9 @@
   bool equals(ScriptableFilterExpression *other,
               ScriptableContext *scriptableC);
 
-  // list? QScriptValueList? Make this a ScriptClass?
-
 private:
   Grantlee::FilterExpression m_filterExpression;
-  QScriptEngine *m_engine;
+  QJSEngine *m_engine;
 };
 
 #endif
diff -Naur grantlee-5.1.0/templates/scriptabletags/scriptablefilter.h grantlee/templates/scriptabletags/scriptablefilter.h
--- grantlee-5.1.0/templates/scriptabletags/scriptablefilter.h	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/scriptablefilter.h	2019-07-09 09:53:47.146090817 -0500
@@ -21,7 +21,7 @@
 #ifndef SCRIPTABLE_FILTER_H
 #define SCRIPTABLE_FILTER_H
 
-#include <QtScript/QScriptValue>
+#include <QtQml/QJSValue>
 
 #include "filter.h"
 
@@ -30,7 +30,7 @@
 class ScriptableFilter : public Filter
 {
 public:
-  ScriptableFilter(const QScriptValue &filterObject, QScriptEngine *engine);
+  ScriptableFilter(const QJSValue &filterObject, QJSEngine *engine);
   ~ScriptableFilter() override;
 
   QVariant doFilter(const QVariant &input, const QVariant &argument,
@@ -39,8 +39,8 @@
   bool isSafe() const override;
 
 private:
-  QScriptValue m_filterObject;
-  QScriptEngine *m_scriptEngine;
+  QJSValue m_filterObject;
+  QJSEngine *m_scriptEngine;
 };
 
 #endif
diff -Naur grantlee-5.1.0/templates/scriptabletags/scriptablenode.cpp grantlee/templates/scriptabletags/scriptablenode.cpp
--- grantlee-5.1.0/templates/scriptabletags/scriptablenode.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/scriptablenode.cpp	2019-07-09 09:53:47.146090817 -0500
@@ -20,7 +20,7 @@
 
 #include "scriptablenode.h"
 
-#include <QtScript/QScriptEngine>
+#include <QtQml/QJSEngine>
 
 #include "context.h"
 #include "engine.h"
@@ -29,53 +29,18 @@
 #include "scriptablecontext.h"
 #include "scriptableparser.h"
 
-QScriptValue nodeToScriptValue(QScriptEngine *engine, Node *const &node)
-{
-  return engine->newQObject(node);
-}
-
-void nodeFromScriptValue(const QScriptValue &object, Node *&out)
-{
-  out = qobject_cast<Node *>(object.toQObject());
-}
-
-Q_SCRIPT_DECLARE_QMETAOBJECT(ScriptableNode, Node *)
-
-QScriptValue ScriptableNodeConstructor(QScriptContext *context,
-                                       QScriptEngine *engine)
-{
-  auto scriptableNodeName = context->argument(0).toString();
-  auto concreteNode = engine->globalObject().property(scriptableNodeName);
-
-  QScriptValueList args;
-  // First is the node type
-  for (auto i = 1; i < context->argumentCount(); ++i) {
-    args << context->argument(i);
-  }
-
-  concreteNode.call(concreteNode, args);
-
-  auto renderMethod = concreteNode.property(QStringLiteral("render"));
-
-  auto object = new ScriptableNode(engine);
-  object->setObjectName(scriptableNodeName);
-  object->setScriptEngine(engine);
-  object->init(concreteNode, renderMethod);
-  return engine->newQObject(object);
-}
-
 ScriptableNode::ScriptableNode(QObject *parent)
     : Node(parent), m_scriptEngine(0)
 {
 }
 
-void ScriptableNode::setScriptEngine(QScriptEngine *engine)
+void ScriptableNode::setScriptEngine(QJSEngine *engine)
 {
   m_scriptEngine = engine;
 }
 
-void ScriptableNode::init(const QScriptValue &concreteNode,
-                          const QScriptValue &renderMethod)
+void ScriptableNode::init(const QJSValue &concreteNode,
+                          const QJSValue &renderMethod)
 {
   m_concreteNode = concreteNode;
   m_renderMethod = renderMethod;
@@ -86,14 +51,14 @@
   ScriptableContext sc(c);
   auto contextObject = m_scriptEngine->newQObject(&sc);
 
-  QScriptValueList args;
+  QJSValueList args;
   args << contextObject;
 
   // Call the render method in the context of the concreteNode
-  auto value
-      = const_cast<QScriptValue &>(m_renderMethod).call(m_concreteNode, args);
+  auto value = const_cast<QJSValue &>(m_renderMethod)
+                   .callWithInstance(m_concreteNode, args);
 
-  if (value.isValid() && !value.isUndefined())
+  if (!value.isError() && !value.isUndefined())
     (*stream) << value.toString();
 }
 
@@ -102,7 +67,7 @@
 {
 }
 
-void ScriptableNodeFactory::setScriptEngine(QScriptEngine *engine)
+void ScriptableNodeFactory::setScriptEngine(QJSEngine *engine)
 {
   m_scriptEngine = engine;
 }
@@ -112,42 +77,35 @@
   m_scriptEngine->setProperty("templateEngine", QVariant::fromValue(engine));
 }
 
-void ScriptableNodeFactory::setFactory(const QScriptValue &factoryMethod)
+void ScriptableNodeFactory::setFactory(const QJSValue &factoryMethod)
 {
   m_factoryMethod = factoryMethod;
 }
 
 Node *ScriptableNodeFactory::getNode(const QString &tagContent, Parser *p) const
 {
-  if (m_scriptEngine->hasUncaughtException()) {
-    throw Grantlee::Exception(TagSyntaxError,
-                              m_scriptEngine->uncaughtExceptionBacktrace().join(
-                                  QChar::fromLatin1(' ')));
-  }
   auto sp = new ScriptableParser(p, m_scriptEngine);
   auto parserObject = m_scriptEngine->newQObject(sp);
 
-  QScriptValueList args;
+  QJSValueList args;
   args << tagContent;
   args << parserObject;
 
   auto factory = m_factoryMethod;
 
-  auto scriptNode = factory.call(factory, args);
-  if (m_scriptEngine->hasUncaughtException())
-    throw Grantlee::Exception(TagSyntaxError,
-                              m_scriptEngine->uncaughtExceptionBacktrace().join(
-                                  QChar::fromLatin1(' ')));
+  auto scriptNode = factory.callWithInstance(factory, args);
+  if (scriptNode.isError())
+    throw Grantlee::Exception(TagSyntaxError, scriptNode.toString());
 
-  auto node = qscriptvalue_cast<Node *>(scriptNode);
+  auto node = qjsvalue_cast<Node *>(scriptNode);
   node->setParent(p);
   return node;
 }
 
-QScriptEngine *ScriptableNode::engine() { return m_scriptEngine; }
+QJSEngine *ScriptableNode::engine() { return m_scriptEngine; }
 
 void ScriptableNode::setNodeList(const QString &name,
-                                 const QObjectList &objectList)
+                                 const QList<QObject *> &objectList)
 {
   auto objectListArray = m_scriptEngine->newArray(objectList.size());
 
diff -Naur grantlee-5.1.0/templates/scriptabletags/scriptablenode.h grantlee/templates/scriptabletags/scriptablenode.h
--- grantlee-5.1.0/templates/scriptabletags/scriptablenode.h	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/scriptablenode.h	2019-07-09 09:53:47.146090817 -0500
@@ -21,14 +21,11 @@
 #ifndef SCRIPTABLE_NODE_H
 #define SCRIPTABLE_NODE_H
 
-#include <QtScript/QScriptValue>
-
-#include <QtCore/QSharedPointer>
+#include <QtQml/QJSValue>
 
 #include "node.h"
 
-class QScriptEngine;
-class QScriptContext;
+class QJSEngine;
 
 namespace Grantlee
 {
@@ -36,36 +33,27 @@
 class Engine;
 }
 
-typedef QSharedPointer<QScriptEngine> ScriptEnginePointer;
-
 using namespace Grantlee;
 
-QScriptValue ScriptableNodeConstructor(QScriptContext *context,
-                                       QScriptEngine *engine);
-
-QScriptValue nodeToScriptValue(QScriptEngine *engine, Node *const &node);
-
-void nodeFromScriptValue(const QScriptValue &object, Node *&out);
-
 class ScriptableNode : public Node
 {
   Q_OBJECT
 public:
   ScriptableNode(QObject *parent = 0);
-  void setScriptEngine(QScriptEngine *engine);
-  void init(const QScriptValue &concreteNode, const QScriptValue &renderMethod);
+  void setScriptEngine(QJSEngine *engine);
+  void init(const QJSValue &concreteNode, const QJSValue &renderMethod);
 
-  QScriptEngine *engine();
+  QJSEngine *engine();
 
   void render(OutputStream *stream, Context *c) const override;
 
 private:
-  QScriptEngine *m_scriptEngine;
-  QScriptValue m_concreteNode;
-  QScriptValue m_renderMethod;
+  QJSEngine *m_scriptEngine;
+  QJSValue m_concreteNode;
+  QJSValue m_renderMethod;
 
 public Q_SLOTS:
-  void setNodeList(const QString &name, const QObjectList &);
+  void setNodeList(const QString &name, const QList<QObject *> &);
 };
 
 class ScriptableNodeFactory : public AbstractNodeFactory
@@ -73,16 +61,16 @@
   Q_OBJECT
 public:
   ScriptableNodeFactory(QObject *parent = 0);
-  void setScriptEngine(QScriptEngine *engine);
+  void setScriptEngine(QJSEngine *engine);
 
   /* reimp */ void setEngine(Grantlee::Engine *engine) override;
-  void setFactory(const QScriptValue &factoryMethod);
+  void setFactory(const QJSValue &factoryMethod);
 
   Node *getNode(const QString &tagContent, Parser *p = 0) const override;
 
 private:
-  QScriptEngine *m_scriptEngine;
-  QScriptValue m_factoryMethod;
+  QJSEngine *m_scriptEngine;
+  QJSValue m_factoryMethod;
 };
 
 #endif
diff -Naur grantlee-5.1.0/templates/scriptabletags/scriptableparser.cpp grantlee/templates/scriptabletags/scriptableparser.cpp
--- grantlee-5.1.0/templates/scriptabletags/scriptableparser.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/scriptableparser.cpp	2019-07-09 09:53:47.146090817 -0500
@@ -19,12 +19,13 @@
 */
 
 #include "scriptableparser.h"
-#include "scriptablenode.h"
 
 #include "parser.h"
 
-ScriptableParser::ScriptableParser(Grantlee::Parser *p, QObject *parent)
-    : QObject(parent), m_p(p)
+#include <QtQml/QJSEngine>
+
+ScriptableParser::ScriptableParser(Grantlee::Parser *p, QJSEngine *engine)
+    : QObject(engine), m_p(p), m_engine(engine)
 {
 }
 
@@ -34,22 +35,30 @@
 
 void ScriptableParser::loadLib(const QString &name) { m_p->loadLib(name); }
 
-Token ScriptableParser::takeNextToken() { return m_p->takeNextToken(); }
+QJSValue ScriptableParser::takeNextToken()
+{
+  Token t = m_p->takeNextToken();
+  auto obj = m_engine->newObject();
+  obj.setProperty(QStringLiteral("tokenType"), t.tokenType);
+  obj.setProperty(QStringLiteral("content"), t.content);
+  return obj;
+}
 
 void ScriptableParser::skipPast(const QString &tag) { m_p->skipPast(tag); }
 
-QObjectList ScriptableParser::parse(QObject *parent, const QString &stopAt)
+QList<QObject *> ScriptableParser::parse(QObject *parent, const QString &stopAt)
 {
   return parse(parent, QStringList() << stopAt);
 }
 
-QObjectList ScriptableParser::parse(QObject *parent, const QStringList &stopAt)
+QList<QObject *> ScriptableParser::parse(QObject *parent,
+                                         const QStringList &stopAt)
 {
   auto node = qobject_cast<Node *>(parent);
   Q_ASSERT(node);
 
   auto nodeList = m_p->parse(node, stopAt);
-  QObjectList objList;
+  QList<QObject *> objList;
   QListIterator<Node *> it(nodeList);
   while (it.hasNext()) {
     objList << it.next();
diff -Naur grantlee-5.1.0/templates/scriptabletags/scriptableparser.h grantlee/templates/scriptabletags/scriptableparser.h
--- grantlee-5.1.0/templates/scriptabletags/scriptableparser.h	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/scriptableparser.h	2019-07-09 09:53:47.146090817 -0500
@@ -23,10 +23,7 @@
 
 #include <QtCore/QObject>
 #include <QtCore/QStringList>
-#include <QtCore/QVariant>
-#include <QtScript/QScriptValue>
-
-#include "token.h"
+#include <QtQml/QJSValue>
 
 namespace Grantlee
 {
@@ -39,17 +36,18 @@
 {
   Q_OBJECT
 public:
-  explicit ScriptableParser(Parser *p, QObject *parent = 0);
+  explicit ScriptableParser(Parser *p, QJSEngine *engine);
 
   Parser *parser() { return m_p; }
 
 public Q_SLOTS:
-  QObjectList parse(QObject *parent, const QString &stopAt);
-  QObjectList parse(QObject *parent, const QStringList &stopAt = QStringList());
+  QList<QObject *> parse(QObject *parent, const QString &stopAt);
+  QList<QObject *> parse(QObject *parent,
+                         const QStringList &stopAt = QStringList());
 
   void skipPast(const QString &tag);
 
-  Token takeNextToken();
+  QJSValue takeNextToken();
   bool hasNextToken() const;
   void removeNextToken();
 
@@ -57,6 +55,7 @@
 
 private:
   Parser *m_p;
+  QJSEngine *m_engine;
 };
 
 #endif
diff -Naur grantlee-5.1.0/templates/scriptabletags/scriptablesafestring.cpp grantlee/templates/scriptabletags/scriptablesafestring.cpp
--- grantlee-5.1.0/templates/scriptabletags/scriptablesafestring.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/scriptablesafestring.cpp	2019-07-09 09:53:47.146090817 -0500
@@ -20,31 +20,6 @@
 
 #include "scriptablesafestring.h"
 
-#include <QtScript/QScriptEngine>
-
-#include "util.h"
-
-QScriptValue markSafeFunction(QScriptContext *context, QScriptEngine *engine)
-{
-  auto inputValue = context->argument(0);
-  if (inputValue.isQObject()) {
-    auto obj = inputValue.toQObject();
-    auto ssObj = qobject_cast<ScriptableSafeString *>(obj);
-    if (!ssObj)
-      return engine->nullValue();
-
-    ssObj->setSafety(true);
-    return engine->newQObject(ssObj);
-
-  } else if (inputValue.isString()) {
-    auto str = inputValue.toString();
-    auto ssObj = new ScriptableSafeString(engine);
-    ssObj->setContent(markSafe(str));
-    return engine->newQObject(ssObj);
-  }
-  return engine->nullValue();
-}
-
 ScriptableSafeString::ScriptableSafeString(QObject *parent) : QObject(parent) {}
 
 void ScriptableSafeString::setContent(const Grantlee::SafeString &content)
diff -Naur grantlee-5.1.0/templates/scriptabletags/scriptablesafestring.h grantlee/templates/scriptabletags/scriptablesafestring.h
--- grantlee-5.1.0/templates/scriptabletags/scriptablesafestring.h	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/scriptablesafestring.h	2019-07-09 09:53:47.146090817 -0500
@@ -22,16 +22,11 @@
 #define SCRIPTABLE_SAFESTRING
 
 #include <QtCore/QObject>
-#include <QtScript/QScriptValue>
 
 #include "safestring.h"
 
-class QScriptContext;
-
 using namespace Grantlee;
 
-QScriptValue markSafeFunction(QScriptContext *context, QScriptEngine *engine);
-
 class ScriptableSafeString : public QObject
 {
   Q_OBJECT
diff -Naur grantlee-5.1.0/templates/scriptabletags/scriptabletags.cpp grantlee/templates/scriptabletags/scriptabletags.cpp
--- grantlee-5.1.0/templates/scriptabletags/scriptabletags.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/scriptabletags.cpp	2019-07-09 09:53:47.147090798 -0500
@@ -23,11 +23,14 @@
 #include <QtCore/QFile>
 #include <QtPlugin>
 
-#include <QtScript/QScriptEngine>
+#include <QtQml/QJSEngine>
+#include <QtQml/QJSValueIterator>
 
 #include "nodebuiltins_p.h"
 
+#include "engine.h"
 #include "exception.h"
+#include "parser.h"
 #include "scriptablefilter.h"
 #include "scriptablefilterexpression.h"
 #include "scriptablenode.h"
@@ -36,69 +39,129 @@
 #include "scriptablevariable.h"
 
 #include "token.h"
+#include "util.h"
 
 Q_DECLARE_METATYPE(Token)
 
 using namespace Grantlee;
 
-QScriptValue tokenToScriptValue(QScriptEngine *engine, const Token &t)
+QJSValue ScriptableHelperFunctions::markSafeFunction(QJSValue inputValue)
 {
-  auto obj = engine->newObject();
-  obj.setProperty(QStringLiteral("tokenType"), t.tokenType);
-  obj.setProperty(QStringLiteral("content"), t.content);
-  return obj;
+  if (inputValue.isQObject()) {
+    auto obj = inputValue.toQObject();
+    auto ssObj = qobject_cast<ScriptableSafeString *>(obj);
+    if (!ssObj)
+      return QJSValue::NullValue;
+
+    ssObj->setSafety(true);
+    return m_scriptEngine->newQObject(ssObj);
+
+  } else if (inputValue.isString()) {
+    auto str = inputValue.toString();
+    auto ssObj = new ScriptableSafeString(m_scriptEngine);
+    ssObj->setContent(markSafe(str));
+    return m_scriptEngine->newQObject(ssObj);
+  }
+  return QJSValue::NullValue;
 }
 
-void tokenFromScriptValue(const QScriptValue &obj, Token &t)
+QJSValue ScriptableHelperFunctions::ScriptableFilterExpressionConstructor(
+    QString name, QObject *parserObj)
 {
-  t.tokenType = obj.property(QStringLiteral("tokenType")).toInt32();
-  t.content = obj.property(QStringLiteral("content")).toString();
+  auto object = new ScriptableFilterExpression(m_scriptEngine);
+
+  auto p = qobject_cast<Parser *>(parserObj);
+
+  object->init(name, p);
+
+  return m_scriptEngine->newQObject(object);
 }
 
-ScriptableTagLibrary::ScriptableTagLibrary(QObject *parent)
-    : QObject(parent), m_scriptEngine(0)
+QJSValue
+ScriptableHelperFunctions::ScriptableNodeConstructor(QJSValue callContext)
 {
-  m_scriptEngine = new QScriptEngine(this);
+  QJSValueIterator it(callContext);
+  it.next();
+  auto scriptableNodeName = it.value().toString();
+  auto concreteNode
+      = m_scriptEngine->globalObject().property(scriptableNodeName);
+
+  QJSValueList args;
+  while (it.next())
+    args << it.value();
+
+  concreteNode = concreteNode.callAsConstructor(args);
 
-  qScriptRegisterMetaType(m_scriptEngine, tokenToScriptValue,
-                          tokenFromScriptValue);
-  qScriptRegisterMetaType(m_scriptEngine, nodeToScriptValue,
-                          nodeFromScriptValue);
-  //   qScriptRegisterMetaType(m_scriptEngine.data(), tokenToScriptValue,
-  //   tokenFromScriptValue);
-  //   qScriptRegisterMetaType(m_scriptEngine.data(), nodeToScriptValue,
-  //   nodeFromScriptValue);
+  auto renderMethod = concreteNode.property(QStringLiteral("render"));
+
+  auto object = new ScriptableNode(m_scriptEngine);
+  object->setObjectName(scriptableNodeName);
+  object->setScriptEngine(m_scriptEngine);
+  object->init(concreteNode, renderMethod);
+  return m_scriptEngine->newQObject(object);
+}
+
+QJSValue ScriptableHelperFunctions::ScriptableTemplateConstructor(
+    QString content, QString name, QObject *parent)
+{
+  auto templateEngine
+      = m_scriptEngine->property("templateEngine").value<Engine *>();
+
+  if (!templateEngine)
+    return QJSValue();
+
+  auto t = templateEngine->newTemplate(content, name);
+
+  auto object = new ScriptableTemplate(t, parent);
+  return m_scriptEngine->newQObject(object);
+}
+
+QJSValue ScriptableHelperFunctions::ScriptableVariableConstructor(QString name)
+{
+  // TODO: Decide what the parent should be;
+  // It should be the owning scriptableNode. I think I can get that from the
+  // scriptContext.
+
+  QObject *parent = 0;
+  auto object = new ScriptableVariable(m_scriptEngine, parent);
+  object->setContent(name);
+
+  return m_scriptEngine->newQObject(object);
+}
+
+ScriptableTagLibrary::ScriptableTagLibrary(QObject *parent)
+    : QObject(parent), m_scriptEngine(new QJSEngine(this)),
+      m_functions(m_scriptEngine->newQObject(
+          new ScriptableHelperFunctions(m_scriptEngine)))
+{
+  m_scriptEngine->globalObject().setProperty(
+      QStringLiteral("internalGrantleeFunctions"), m_functions);
 
   // Make Node new-able
-  auto nodeCtor = m_scriptEngine->newFunction(ScriptableNodeConstructor);
-  auto nodeMetaObject = m_scriptEngine->newQMetaObject(
-      &ScriptableNode::staticMetaObject, nodeCtor);
-  m_scriptEngine->globalObject().setProperty(QStringLiteral("Node"),
-                                             nodeMetaObject);
+  m_scriptEngine->globalObject().setProperty(
+      QStringLiteral("Node"),
+      m_scriptEngine->evaluate(QStringLiteral(R"javascript(
+            (function() {
+              return internalGrantleeFunctions.ScriptableNodeConstructor(
+                Array.prototype.slice.call(arguments));
+            })
+          )javascript")));
 
   // Make Variable new-able
-  auto variableCtor
-      = m_scriptEngine->newFunction(ScriptableVariableConstructor);
-  auto variableMetaObject = m_scriptEngine->newQMetaObject(
-      &VariableNode::staticMetaObject, variableCtor);
-  m_scriptEngine->globalObject().setProperty(QStringLiteral("Variable"),
-                                             variableMetaObject);
+  m_scriptEngine->globalObject().setProperty(
+      QStringLiteral("Variable"),
+      m_functions.property(QStringLiteral("ScriptableVariableConstructor")));
 
   // Make FilterExpression new-able
-  auto filterExpressionCtor
-      = m_scriptEngine->newFunction(ScriptableFilterExpressionConstructor);
-  auto filterExpressionMetaObject = m_scriptEngine->newQMetaObject(
-      &ScriptableFilterExpression::staticMetaObject, filterExpressionCtor);
-  m_scriptEngine->globalObject().setProperty(QStringLiteral("FilterExpression"),
-                                             filterExpressionMetaObject);
+  m_scriptEngine->globalObject().setProperty(
+      QStringLiteral("FilterExpression"),
+      m_functions.property(
+          QStringLiteral("ScriptableFilterExpressionConstructor")));
 
   // Make Template new-able
-  auto templateCtor
-      = m_scriptEngine->newFunction(ScriptableTemplateConstructor);
-  auto templateMetaObject = m_scriptEngine->newQMetaObject(
-      &ScriptableTemplate::staticMetaObject, templateCtor);
-  m_scriptEngine->globalObject().setProperty(QStringLiteral("Template"),
-                                             templateMetaObject);
+  m_scriptEngine->globalObject().setProperty(
+      QStringLiteral("Template"),
+      m_functions.property(QStringLiteral("ScriptableTemplateConstructor")));
 
   // Create a global Library object
   auto libraryObject = m_scriptEngine->newQObject(this);
@@ -112,9 +175,9 @@
       QStringLiteral("AbstractNodeFactory"), nodeFactoryObject);
 
   // Make mark_safe a globally available object.
-  auto markSafeFunctionObject = m_scriptEngine->newFunction(markSafeFunction);
-  m_scriptEngine->globalObject().setProperty(QStringLiteral("mark_safe"),
-                                             markSafeFunctionObject);
+  m_scriptEngine->globalObject().setProperty(
+      QStringLiteral("mark_safe"),
+      m_functions.property(QStringLiteral("markSafeFunction")));
 }
 
 bool ScriptableTagLibrary::evaluateScript(const QString &name)
@@ -132,13 +195,10 @@
 
   scriptFile.close();
 
-  m_scriptEngine->evaluate(fileContent);
+  QJSValue result = m_scriptEngine->evaluate(fileContent);
+  if (result.isError())
+    throw Grantlee::Exception(TagSyntaxError, result.toString());
 
-  if (m_scriptEngine->hasUncaughtException()) {
-    throw Grantlee::Exception(TagSyntaxError,
-                              m_scriptEngine->uncaughtExceptionBacktrace().join(
-                                  QChar::fromLatin1(' ')));
-  }
   return true;
 }
 
@@ -202,11 +262,6 @@
     auto filter = new ScriptableFilter(filterObject, m_scriptEngine);
     filters.insert(filterName, filter);
   }
-  if (m_scriptEngine->hasUncaughtException()) {
-    throw Grantlee::Exception(TagSyntaxError,
-                              m_scriptEngine->uncaughtExceptionBacktrace().join(
-                                  QChar::fromLatin1(' ')));
-  }
 
   return filters;
 }
diff -Naur grantlee-5.1.0/templates/scriptabletags/scriptabletags.h grantlee/templates/scriptabletags/scriptabletags.h
--- grantlee-5.1.0/templates/scriptabletags/scriptabletags.h	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/scriptabletags.h	2019-07-09 09:53:47.147090798 -0500
@@ -24,18 +24,37 @@
 #include "node.h"
 #include "taglibraryinterface.h"
 
-// #include <QtScript/QScriptEngine>
+#include <QtQml/QJSValue>
 
-// #include <QtScript/QSharedPointer>
-// typedef QSharedPointer<QScriptEngine> ScriptEnginePointer;
-
-class QScriptEngine;
+class QJSEngine;
 
 namespace Grantlee
 {
 class Engine;
 class Parser;
 
+class ScriptableHelperFunctions : public QObject
+{
+  Q_OBJECT
+  QJSEngine *m_scriptEngine;
+
+public:
+  ScriptableHelperFunctions(QJSEngine *scriptEngine)
+      : m_scriptEngine(scriptEngine)
+  {
+  }
+
+  Q_INVOKABLE QJSValue markSafeFunction(QJSValue inputValue);
+  Q_INVOKABLE QJSValue ScriptableFilterExpressionConstructor(QString name,
+                                                             QObject *parserObj
+                                                             = nullptr);
+  Q_INVOKABLE QJSValue ScriptableNodeConstructor(QJSValue callContext);
+  Q_INVOKABLE QJSValue ScriptableVariableConstructor(QString name);
+  Q_INVOKABLE QJSValue ScriptableTemplateConstructor(QString content,
+                                                     QString name,
+                                                     QObject *parent);
+};
+
 class ScriptableTagLibrary : public QObject, public TagLibraryInterface
 {
   Q_OBJECT
@@ -59,8 +78,8 @@
   QHash<QString, Filter *> getFilters();
 
 private:
-  //   ScriptEnginePointer m_scriptEngine;
-  QScriptEngine *m_scriptEngine;
+  QJSEngine *m_scriptEngine;
+  QJSValue m_functions;
   QHash<QString, AbstractNodeFactory *> m_nodeFactories;
   QHash<QString, QString> m_factoryNames;
   QStringList m_filterNames;
diff -Naur grantlee-5.1.0/templates/scriptabletags/scriptabletemplate.cpp grantlee/templates/scriptabletags/scriptabletemplate.cpp
--- grantlee-5.1.0/templates/scriptabletags/scriptabletemplate.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/scriptabletemplate.cpp	2019-07-09 09:53:47.147090798 -0500
@@ -20,30 +20,9 @@
 
 #include "scriptabletemplate.h"
 
-#include <QtScript/QScriptContext>
-#include <QtScript/QScriptEngine>
-
 #include "context.h"
 #include "engine.h"
 #include "node.h"
-#include "scriptablecontext.h"
-
-QScriptValue ScriptableTemplateConstructor(QScriptContext *context,
-                                           QScriptEngine *engine)
-{
-  auto content = context->argument(0).toString();
-  auto name = context->argument(1).toString();
-  auto parent = context->argument(2).toQObject();
-  auto templateEngine = engine->property("templateEngine").value<Engine *>();
-
-  if (!templateEngine)
-    return QScriptValue();
-
-  auto t = templateEngine->newTemplate(content, name);
-
-  auto object = new ScriptableTemplate(t, parent);
-  return engine->newQObject(object);
-}
 
 ScriptableTemplate::ScriptableTemplate(Grantlee::Template t, QObject *parent)
     : QObject(parent), m_template(t)
@@ -55,10 +34,10 @@
   return m_template->render(c->context());
 }
 
-QObjectList ScriptableTemplate::nodeList() const
+QList<QObject *> ScriptableTemplate::nodeList() const
 {
   auto nodeList = m_template->nodeList();
-  QObjectList objList;
+  QList<QObject *> objList;
 
   QListIterator<Node *> it(nodeList);
   while (it.hasNext()) {
@@ -67,7 +46,7 @@
   return objList;
 }
 
-void ScriptableTemplate::setNodeList(const QObjectList &list)
+void ScriptableTemplate::setNodeList(const QList<QObject *> &list)
 {
   NodeList nodeList;
 
diff -Naur grantlee-5.1.0/templates/scriptabletags/scriptabletemplate.h grantlee/templates/scriptabletags/scriptabletemplate.h
--- grantlee-5.1.0/templates/scriptabletags/scriptabletemplate.h	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/scriptabletemplate.h	2019-07-09 09:53:47.147090798 -0500
@@ -22,10 +22,8 @@
 #define SCRIPTABLE_TEMPLATE_H
 
 #include <QtCore/QObject>
-#include <QtCore/QVariant>
-
-#include <QtScript/QScriptValue>
 
+#include "scriptablecontext.h"
 #include "template.h"
 
 namespace Grantlee
@@ -33,15 +31,8 @@
 class Node;
 }
 
-class QScriptContext;
-
-class ScriptableContext;
-
 using namespace Grantlee;
 
-QScriptValue ScriptableTemplateConstructor(QScriptContext *context,
-                                           QScriptEngine *engine);
-
 class ScriptableTemplate : public QObject
 {
   Q_OBJECT
@@ -51,9 +42,9 @@
 public Q_SLOTS:
   QString render(ScriptableContext *c) const;
 
-  QObjectList nodeList() const;
+  QList<QObject *> nodeList() const;
 
-  void setNodeList(const QObjectList &list);
+  void setNodeList(const QList<QObject *> &list);
 
 private:
   Template m_template;
diff -Naur grantlee-5.1.0/templates/scriptabletags/scriptablevariable.cpp grantlee/templates/scriptabletags/scriptablevariable.cpp
--- grantlee-5.1.0/templates/scriptabletags/scriptablevariable.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/scriptablevariable.cpp	2019-07-09 09:53:47.147090798 -0500
@@ -20,35 +20,17 @@
 
 #include "scriptablevariable.h"
 
-#include <QDebug>
-#include <QtScript/QScriptEngine>
+#include <QtQml/QJSEngine>
 
-#include "scriptablecontext.h"
 #include "scriptablesafestring.h"
 #include "util.h"
 
-Q_SCRIPT_DECLARE_QMETAOBJECT(ScriptableVariable, QObject *)
-
-QScriptValue ScriptableVariableConstructor(QScriptContext *context,
-                                           QScriptEngine *engine)
-{
-  // TODO: Decide what the parent should be;
-  // It should be the owning scriptableNode. I think I can get that from the
-  // scriptContext.
-
-  QObject *parent = 0;
-  auto object = new ScriptableVariable(engine, parent);
-  object->setContent(context->argument(0).toString());
-
-  return engine->newQObject(object);
-}
-
 ScriptableVariable::ScriptableVariable(QObject *parent)
     : QObject(parent), m_engine(0)
 {
 }
 
-ScriptableVariable::ScriptableVariable(QScriptEngine *engine, QObject *parent)
+ScriptableVariable::ScriptableVariable(QJSEngine *engine, QObject *parent)
     : QObject(parent), m_engine(engine)
 {
 }
diff -Naur grantlee-5.1.0/templates/scriptabletags/scriptablevariable.h grantlee/templates/scriptabletags/scriptablevariable.h
--- grantlee-5.1.0/templates/scriptabletags/scriptablevariable.h	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/scriptabletags/scriptablevariable.h	2019-07-09 09:53:47.147090798 -0500
@@ -22,25 +22,19 @@
 #define SCRIPTABLE_VARIABLE_H
 
 #include <QtCore/QObject>
-#include <QtScript/QScriptValue>
+#include <QtQml/QJSValue>
 
+#include "scriptablecontext.h"
 #include "variable.h"
 
-class QScriptContext;
-
-class ScriptableContext;
-
 using namespace Grantlee;
 
-QScriptValue ScriptableVariableConstructor(QScriptContext *context,
-                                           QScriptEngine *engine);
-
 class ScriptableVariable : public QObject
 {
   Q_OBJECT
 public:
   ScriptableVariable(QObject *parent = 0);
-  ScriptableVariable(QScriptEngine *engine, QObject *parent = 0);
+  ScriptableVariable(QJSEngine *engine, QObject *parent = 0);
 
   void setContent(const QString &content);
 
@@ -51,7 +45,7 @@
 
 private:
   Variable m_variable;
-  QScriptEngine *m_engine;
+  QJSEngine *m_engine;
 };
 
 #endif
diff -Naur grantlee-5.1.0/templates/tests/benchmarks.cpp grantlee/templates/tests/benchmarks.cpp
--- grantlee-5.1.0/templates/tests/benchmarks.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/tests/benchmarks.cpp	2019-07-09 09:53:47.147090798 -0500
@@ -75,7 +75,12 @@
 
   m_engine->setPluginPaths(QStringList(QStringLiteral(GRANTLEE_PLUGIN_PATH)));
 
-  m_templateGeneratorString = QStringLiteral("Lorem {% for i in items %} Ipsum {% templatetag openblock %} if boo {% templatetag closeblock %} bar {% templatetag openvariable %} bat|upper {% templatetag closevariable %} baz {{ i }} dolor {% templatetag openblock %} endif {% templatetag closeblock %} sit.{% endfor %} amet.\n");
+  m_templateGeneratorString = QStringLiteral(
+      "Lorem {% for i in items %} Ipsum {% templatetag openblock %} if boo {% "
+      "templatetag closeblock %} bar {% templatetag openvariable %} bat|upper "
+      "{% templatetag closevariable %} baz {{ i }} dolor {% templatetag "
+      "openblock %} endif {% templatetag closeblock %} sit.{% endfor %} "
+      "amet.\n");
 
   m_templateGenerator = m_engine->newTemplate(m_templateGeneratorString,
                                               QStringLiteral("generator"));
diff -Naur grantlee-5.1.0/templates/tests/CMakeLists.txt grantlee/templates/tests/CMakeLists.txt
--- grantlee-5.1.0/templates/tests/CMakeLists.txt	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/tests/CMakeLists.txt	2019-07-09 09:53:47.147090798 -0500
@@ -99,8 +99,8 @@
     add_test(${_testname} ${_testname}_exec )
     target_link_libraries(${_testname}_exec Grantlee5::Templates template_test_builtins)
 
-    if (Qt5Script_FOUND)
-      target_compile_definitions(${_testname}_exec PRIVATE HAVE_QTSCRIPT_LIB)
+    if (Qt5Qml_FOUND)
+      target_compile_definitions(${_testname}_exec PRIVATE HAVE_QTQML_LIB)
     endif()
 
     set_property(GLOBAL APPEND PROPERTY TEST_COVERAGE "${CMAKE_CURRENT_BINARY_DIR}/${_testname}_exec" )
@@ -119,7 +119,7 @@
 #   benchmarks
 )
 
-if (Qt5Script_FOUND)
+if (Qt5Qml_FOUND)
   grantlee_templates_unit_tests(
     testscriptabletags
   )
diff -Naur grantlee-5.1.0/templates/tests/testbuiltins.cpp grantlee/templates/tests/testbuiltins.cpp
--- grantlee-5.1.0/templates/tests/testbuiltins.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/tests/testbuiltins.cpp	2019-07-09 09:53:47.148090778 -0500
@@ -354,9 +354,9 @@
   QTest::newRow("basic-syntax00") << QString() << dict << QString() << NoError;
 
   // Plain text should go through the template parser untouched
-  QTest::newRow("basic-syntax01") << QStringLiteral("something cool") << dict
-                                  << QStringLiteral("something cool")
-                                  << NoError;
+  QTest::newRow("basic-syntax01")
+      << QStringLiteral("something cool") << dict
+      << QStringLiteral("something cool") << NoError;
 
   // Variables should be replaced with their value in the current
   // context
@@ -382,8 +382,8 @@
   QTest::newRow("basic-syntax06") << QStringLiteral("{{ multi word variable }}")
                                   << dict << QString() << TagSyntaxError;
   // Raise TemplateSyntaxError for empty variable tags
-  QTest::newRow("basic-syntax07") << QStringLiteral("{{ }}") << dict
-                                  << QString() << EmptyVariableError;
+  QTest::newRow("basic-syntax07")
+      << QStringLiteral("{{ }}") << dict << QString() << EmptyVariableError;
   QTest::newRow("basic-syntax08") << QStringLiteral("{{        }}") << dict
                                   << QString() << EmptyVariableError;
 
@@ -392,9 +392,9 @@
   auto someClass = new SomeClass(this);
   dict.insert(QStringLiteral("var"), QVariant::fromValue(someClass));
 
-  QTest::newRow("basic-syntax09") << QStringLiteral("{{ var.method }}") << dict
-                                  << QStringLiteral("SomeClass::method")
-                                  << NoError;
+  QTest::newRow("basic-syntax09")
+      << QStringLiteral("{{ var.method }}") << dict
+      << QStringLiteral("SomeClass::method") << NoError;
 
   // Multiple levels of attribute access are allowed
   QTest::newRow("basic-syntax10")
@@ -402,8 +402,8 @@
       << QStringLiteral("OtherClass::method") << NoError;
 
   // Fail silently when a variable's attribute isn't found
-  QTest::newRow("basic-syntax11") << QStringLiteral("{{ var.blech }}") << dict
-                                  << QString() << NoError;
+  QTest::newRow("basic-syntax11")
+      << QStringLiteral("{{ var.blech }}") << dict << QString() << NoError;
 
   // TODO: Needed?
   // Raise TemplateSyntaxError when trying to access a variable beginning with
@@ -419,18 +419,18 @@
   dict.clear();
   // Raise TemplateSyntaxError when trying to access a variable containing an
   // illegal character
-  QTest::newRow("basic-syntax13") << QStringLiteral("{{ va>r }}") << dict
-                                  << QString() << TagSyntaxError;
-  QTest::newRow("basic-syntax14") << QStringLiteral("{{ (var.r) }}") << dict
-                                  << QString() << TagSyntaxError;
-  QTest::newRow("basic-syntax15") << QStringLiteral("{{ sp%am }}") << dict
-                                  << QString() << TagSyntaxError;
-  QTest::newRow("basic-syntax16") << QStringLiteral("{{ eggs! }}") << dict
-                                  << QString() << TagSyntaxError;
-  QTest::newRow("basic-syntax17") << QStringLiteral("{{ moo? }}") << dict
-                                  << QString() << TagSyntaxError;
-  QTest::newRow("basic-syntax-error01") << QStringLiteral("{{ moo:arg }}")
-                                        << dict << QString() << TagSyntaxError;
+  QTest::newRow("basic-syntax13")
+      << QStringLiteral("{{ va>r }}") << dict << QString() << TagSyntaxError;
+  QTest::newRow("basic-syntax14")
+      << QStringLiteral("{{ (var.r) }}") << dict << QString() << TagSyntaxError;
+  QTest::newRow("basic-syntax15")
+      << QStringLiteral("{{ sp%am }}") << dict << QString() << TagSyntaxError;
+  QTest::newRow("basic-syntax16")
+      << QStringLiteral("{{ eggs! }}") << dict << QString() << TagSyntaxError;
+  QTest::newRow("basic-syntax17")
+      << QStringLiteral("{{ moo? }}") << dict << QString() << TagSyntaxError;
+  QTest::newRow("basic-syntax-error01")
+      << QStringLiteral("{{ moo:arg }}") << dict << QString() << TagSyntaxError;
   QTest::newRow("basic-syntax-error02")
       << QStringLiteral("{{ moo|cut:'foo':'bar' }}") << dict << QString()
       << TagSyntaxError;
@@ -444,8 +444,8 @@
                                   << QStringLiteral("baz") << NoError;
 
   // Fail silently when a variable's dictionary key isn't found
-  QTest::newRow("basic-syntax19") << QStringLiteral("{{ foo.spam }}") << dict
-                                  << QString() << NoError;
+  QTest::newRow("basic-syntax19")
+      << QStringLiteral("{{ foo.spam }}") << dict << QString() << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("var"), QVariant::fromValue(someClass));
@@ -470,16 +470,16 @@
 
   dict.clear();
   // Embedded newlines make it not-a-tag.
-  QTest::newRow("basic-syntax24") << "{{ moo\n }}" << dict << "{{ moo\n }}"
-                                  << NoError;
+  QTest::newRow("basic-syntax24")
+      << "{{ moo\n }}" << dict << "{{ moo\n }}" << NoError;
   // Literal strings are permitted inside variables, mostly for i18n
   // purposes.
-  QTest::newRow("basic-syntax25") << "{{ \"fred\" }}" << dict
-                                  << QStringLiteral("fred") << NoError;
-  QTest::newRow("basic-syntax26") << "{{ \"\\\"fred\\\"\" }}" << dict
-                                  << "\"fred\"" << NoError;
-  QTest::newRow("basic-syntax27") << "{{ _(\"\\\"fred\\\"\") }}" << dict
-                                  << "\"fred\"" << NoError;
+  QTest::newRow("basic-syntax25")
+      << "{{ \"fred\" }}" << dict << QStringLiteral("fred") << NoError;
+  QTest::newRow("basic-syntax26")
+      << "{{ \"\\\"fred\\\"\" }}" << dict << "\"fred\"" << NoError;
+  QTest::newRow("basic-syntax27")
+      << "{{ _(\"\\\"fred\\\"\") }}" << dict << "\"fred\"" << NoError;
 
   dict.clear();
   hash.clear();
@@ -559,8 +559,8 @@
   dict.clear();
 
   dict.insert(QStringLiteral("1"), QStringLiteral("abc"));
-  QTest::newRow("basic-syntax33") << QStringLiteral("{{ 1 }}") << dict
-                                  << QStringLiteral("1") << NoError;
+  QTest::newRow("basic-syntax33")
+      << QStringLiteral("{{ 1 }}") << dict << QStringLiteral("1") << NoError;
   QTest::newRow("basic-syntax34") << QStringLiteral("{{ 1.2 }}") << dict
                                   << QStringLiteral("1.2") << NoError;
 
@@ -572,18 +572,18 @@
       << QStringLiteral("{{ abc._something }} {{ abc._something|upper }}")
       << dict << QString() << TagSyntaxError;
 
-  QTest::newRow("basic-syntax36") << "{{ \"fred }}" << dict << QString()
-                                  << TagSyntaxError;
-  QTest::newRow("basic-syntax37") << "{{ \'fred }}" << dict << QString()
-                                  << TagSyntaxError;
-  QTest::newRow("basic-syntax38") << "{{ \"fred\' }}" << dict << QString()
-                                  << TagSyntaxError;
-  QTest::newRow("basic-syntax39") << "{{ \'fred\" }}" << dict << QString()
-                                  << TagSyntaxError;
-  QTest::newRow("basic-syntax40") << "{{ _(\'fred }}" << dict << QString()
-                                  << TagSyntaxError;
-  QTest::newRow("basic-syntax41") << "{{ abc|removetags:_(\'fred }}" << dict
-                                  << QString() << TagSyntaxError;
+  QTest::newRow("basic-syntax36")
+      << "{{ \"fred }}" << dict << QString() << TagSyntaxError;
+  QTest::newRow("basic-syntax37")
+      << "{{ \'fred }}" << dict << QString() << TagSyntaxError;
+  QTest::newRow("basic-syntax38")
+      << "{{ \"fred\' }}" << dict << QString() << TagSyntaxError;
+  QTest::newRow("basic-syntax39")
+      << "{{ \'fred\" }}" << dict << QString() << TagSyntaxError;
+  QTest::newRow("basic-syntax40")
+      << "{{ _(\'fred }}" << dict << QString() << TagSyntaxError;
+  QTest::newRow("basic-syntax41")
+      << "{{ abc|removetags:_(\'fred }}" << dict << QString() << TagSyntaxError;
 }
 
 void TestBuiltinSyntax::testEnums_data()
@@ -604,26 +604,26 @@
                                  << QStringLiteral("1") << NoError;
   QTest::newRow("class-enums03") << QStringLiteral("{{ var.Bears }}") << dict
                                  << QStringLiteral("2") << NoError;
-  QTest::newRow("class-enums04") << QStringLiteral("{{ var.Hamsters }}") << dict
-                                 << QString() << NoError;
-  QTest::newRow("class-enums05") << QStringLiteral("{{ var.Tigers.name }}")
-                                 << dict << QStringLiteral("Animals")
-                                 << NoError;
-  QTest::newRow("class-enums06") << QStringLiteral("{{ var.Tigers.scope }}")
-                                 << dict << QStringLiteral("OtherClass")
-                                 << NoError;
+  QTest::newRow("class-enums04")
+      << QStringLiteral("{{ var.Hamsters }}") << dict << QString() << NoError;
+  QTest::newRow("class-enums05")
+      << QStringLiteral("{{ var.Tigers.name }}") << dict
+      << QStringLiteral("Animals") << NoError;
+  QTest::newRow("class-enums06")
+      << QStringLiteral("{{ var.Tigers.scope }}") << dict
+      << QStringLiteral("OtherClass") << NoError;
   QTest::newRow("class-enums07") << QStringLiteral("{{ var.Tigers.value }}")
                                  << dict << QStringLiteral("1") << NoError;
   QTest::newRow("class-enums08") << QStringLiteral("{{ var.Tigers.key }}")
                                  << dict << QStringLiteral("Tigers") << NoError;
   QTest::newRow("class-enums09") << QStringLiteral("{{ var.animals }}") << dict
                                  << QStringLiteral("1") << NoError;
-  QTest::newRow("class-enums10") << QStringLiteral("{{ var.animals.name }}")
-                                 << dict << QStringLiteral("Animals")
-                                 << NoError;
-  QTest::newRow("class-enums11") << QStringLiteral("{{ var.animals.scope }}")
-                                 << dict << QStringLiteral("OtherClass")
-                                 << NoError;
+  QTest::newRow("class-enums10")
+      << QStringLiteral("{{ var.animals.name }}") << dict
+      << QStringLiteral("Animals") << NoError;
+  QTest::newRow("class-enums11")
+      << QStringLiteral("{{ var.animals.scope }}") << dict
+      << QStringLiteral("OtherClass") << NoError;
   QTest::newRow("class-enums12") << QStringLiteral("{{ var.animals.value }}")
                                  << dict << QStringLiteral("1") << NoError;
   QTest::newRow("class-enums13") << QStringLiteral("{{ var.animals.key }}")
@@ -632,14 +632,14 @@
                                  << dict << QStringLiteral("0") << NoError;
   QTest::newRow("class-enums15") << QStringLiteral("{{ var.Animals.2 }}")
                                  << dict << QStringLiteral("2") << NoError;
-  QTest::newRow("class-enums16") << QStringLiteral("{{ var.Animals.3 }}")
-                                 << dict << QString() << NoError;
-  QTest::newRow("class-enums17") << QStringLiteral("{{ var.Animals.0.name }}")
-                                 << dict << QStringLiteral("Animals")
-                                 << NoError;
-  QTest::newRow("class-enums18") << QStringLiteral("{{ var.Animals.0.scope }}")
-                                 << dict << QStringLiteral("OtherClass")
-                                 << NoError;
+  QTest::newRow("class-enums16")
+      << QStringLiteral("{{ var.Animals.3 }}") << dict << QString() << NoError;
+  QTest::newRow("class-enums17")
+      << QStringLiteral("{{ var.Animals.0.name }}") << dict
+      << QStringLiteral("Animals") << NoError;
+  QTest::newRow("class-enums18")
+      << QStringLiteral("{{ var.Animals.0.scope }}") << dict
+      << QStringLiteral("OtherClass") << NoError;
   QTest::newRow("class-enums19") << QStringLiteral("{{ var.Animals.0.value }}")
                                  << dict << QStringLiteral("0") << NoError;
   QTest::newRow("class-enums20") << QStringLiteral("{{ var.Animals.0.key }}")
@@ -649,16 +649,20 @@
   QTest::newRow("class-enums22") << QStringLiteral("{{ var.Tigers.samba }}")
                                  << dict << QString() << NoError;
   QTest::newRow("class-enums23")
-      << QStringLiteral("{% with var.animals as result %}{{ result.key }},{{ result }},{{ result.scope }}{% endwith %}")
+      << QStringLiteral("{% with var.animals as result %}{{ result.key }},{{ "
+                        "result }},{{ result.scope }}{% endwith %}")
       << dict << QStringLiteral("Tigers,1,OtherClass") << NoError;
   QTest::newRow("class-enums24")
-      << QStringLiteral("{% with var.Animals.2 as result %}{{ result.key }},{{ result }},{{ result.scope }}{% endwith %}")
+      << QStringLiteral("{% with var.Animals.2 as result %}{{ result.key }},{{ "
+                        "result }},{{ result.scope }}{% endwith %}")
       << dict << QStringLiteral("Bears,2,OtherClass") << NoError;
   QTest::newRow("class-enums25")
-      << QStringLiteral("{% with var.Bears as result %}{{ result.key }},{{ result }},{{ result.scope }}{% endwith %}")
+      << QStringLiteral("{% with var.Bears as result %}{{ result.key }},{{ "
+                        "result }},{{ result.scope }}{% endwith %}")
       << dict << QStringLiteral("Bears,2,OtherClass") << NoError;
   QTest::newRow("class-enums26")
-      << QStringLiteral("{% with var.Animals as result %}{{ result.0.key }},{{ result.1.key }},{{ result.2.key }}{% endwith %}")
+      << QStringLiteral("{% with var.Animals as result %}{{ result.0.key }},{{ "
+                        "result.1.key }},{{ result.2.key }}{% endwith %}")
       << dict << QStringLiteral("Lions,Tigers,Bears") << NoError;
 
   dict.clear();
@@ -678,10 +682,10 @@
                                  << QStringLiteral("4") << NoError;
   QTest::newRow("class-enums32") << QStringLiteral("{{ var.Citizen }}") << dict
                                  << QStringLiteral("8") << NoError;
-  QTest::newRow("class-enums33") << QStringLiteral("{{ var.FirstEnum }}")
-                                 << dict << QString() << NoError;
-  QTest::newRow("class-enums34") << QStringLiteral("{{ var.SecondEnum }}")
-                                 << dict << QString() << NoError;
+  QTest::newRow("class-enums33")
+      << QStringLiteral("{{ var.FirstEnum }}") << dict << QString() << NoError;
+  QTest::newRow("class-enums34")
+      << QStringLiteral("{{ var.SecondEnum }}") << dict << QString() << NoError;
 
   QTest::newRow("class-enums35")
       << QString::fromLatin1(
@@ -742,14 +746,16 @@
                               << dict << QStringLiteral("Alignment") << NoError;
   QTest::newRow("qt-enums04") << QStringLiteral("{{ Qt.AlignRight.value }}")
                               << dict << QStringLiteral("2") << NoError;
-  QTest::newRow("qt-enums05") << QStringLiteral("{{ Qt.AlignRight.key }}")
-                              << dict << QStringLiteral("AlignRight")
-                              << NoError;
-  QTest::newRow("qt-enums06") << QStringLiteral("{{ Qt.Alignment.2.key }}")
-                              << dict << QStringLiteral("AlignRight")
-                              << NoError;
-  QTest::newRow("qt-enums06") << QStringLiteral("{{ Qt.DoesNotExist }}") << dict
+  QTest::newRow("qt-enums05")
+      << QStringLiteral("{{ Qt.AlignRight.key }}") << dict
+      << QStringLiteral("AlignRight") << NoError;
+  QTest::newRow("qt-enums06")
+      << QStringLiteral("{{ Qt.Alignment.2.key }}") << dict
+      << QStringLiteral("AlignRight") << NoError;
+  QTest::newRow("qt-enums07") << QStringLiteral("{{ Qt.DoesNotExist }}") << dict
                               << QString() << NoError;
+  QTest::newRow("qt-enums08")
+      << QStringLiteral("{{ Qt }}") << dict << QString() << NoError;
 }
 
 void TestBuiltinSyntax::testListIndex_data()
@@ -772,21 +778,21 @@
   QTest::newRow("list-index01") << QStringLiteral("{{ var.1 }}") << dict
                                 << QStringLiteral("second item") << NoError;
   // Fail silently when the list index is out of range.
-  QTest::newRow("list-index02") << QStringLiteral("{{ var.5 }}") << dict
-                                << QString() << NoError;
+  QTest::newRow("list-index02")
+      << QStringLiteral("{{ var.5 }}") << dict << QString() << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("var"), QVariant());
 
   // Fail silently when the variable is not a subscriptable object.
-  QTest::newRow("list-index03") << QStringLiteral("{{ var.1 }}") << dict
-                                << QString() << NoError;
+  QTest::newRow("list-index03")
+      << QStringLiteral("{{ var.1 }}") << dict << QString() << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("var"), QVariantHash());
   // Fail silently when variable is a dict without the specified key.
-  QTest::newRow("list-index04") << QStringLiteral("{{ var.1 }}") << dict
-                                << QString() << NoError;
+  QTest::newRow("list-index04")
+      << QStringLiteral("{{ var.1 }}") << dict << QString() << NoError;
 
   dict.clear();
 
@@ -808,9 +814,9 @@
   sl.append(QStringLiteral("world"));
   dict.insert(QStringLiteral("var"), sl);
   // QStringList lookup
-  QTest::newRow("list-index08") << QStringLiteral("{{ var.0 }}, {{ var.1 }}!")
-                                << dict << QStringLiteral("hello, world!")
-                                << NoError;
+  QTest::newRow("list-index08")
+      << QStringLiteral("{{ var.0 }}, {{ var.1 }}!") << dict
+      << QStringLiteral("hello, world!") << NoError;
 }
 
 void TestBuiltinSyntax::testFilterSyntax_data()
@@ -824,9 +830,9 @@
 
   // Basic filter usage
   dict.insert(QStringLiteral("var"), QStringLiteral("Django is the greatest!"));
-  QTest::newRow("filter-syntax01") << QStringLiteral("{{ var|upper }}") << dict
-                                   << QStringLiteral("DJANGO IS THE GREATEST!")
-                                   << NoError;
+  QTest::newRow("filter-syntax01")
+      << QStringLiteral("{{ var|upper }}") << dict
+      << QStringLiteral("DJANGO IS THE GREATEST!") << NoError;
 
   // Chained filters
   QTest::newRow("filter-syntax02")
@@ -856,8 +862,8 @@
       << QStringLiteral("{% nothing_to_see_here %}") << dict << QString()
       << InvalidBlockTagError;
   // Raise TemplateSyntaxError for empty block tags
-  QTest::newRow("filter-syntax08") << QStringLiteral("{% %}") << dict
-                                   << QString() << EmptyBlockTagError;
+  QTest::newRow("filter-syntax08")
+      << QStringLiteral("{% %}") << dict << QString() << EmptyBlockTagError;
 
   // Chained filters, with an argument to the first one
   dict.insert(QStringLiteral("var"), QStringLiteral("<b><i>Yes</i></b>"));
@@ -909,8 +915,8 @@
   dict.insert(QStringLiteral("var"), QVariantList() << QStringLiteral("a")
                                                     << QStringLiteral("b")
                                                     << QStringLiteral("c"));
-  QTest::newRow("filter-syntax17") << "{{ var|join:\"\" }}" << dict
-                                   << QStringLiteral("abc") << NoError;
+  QTest::newRow("filter-syntax17")
+      << "{{ var|join:\"\" }}" << dict << QStringLiteral("abc") << NoError;
 
   // Make sure that any unicode strings are converted to bytestrings
   // in the final output.
@@ -1023,9 +1029,9 @@
 
   // Unlike variable args.
   dict.insert(QStringLiteral("amp"), QStringLiteral(" & "));
-  QTest::newRow("escape06") << QStringLiteral("{{ varList|join:amp }}") << dict
-                            << QStringLiteral("Tom &amp; Dick &amp; Harry")
-                            << NoError;
+  QTest::newRow("escape06")
+      << QStringLiteral("{{ varList|join:amp }}") << dict
+      << QStringLiteral("Tom &amp; Dick &amp; Harry") << NoError;
 
   // Literal strings are safe.
   QTest::newRow("escape07") << "{{ \"this & that\" }}" << dict
@@ -1145,10 +1151,10 @@
   QTest::addColumn<QString>("inputPath");
   QTest::addColumn<QString>("output");
 
-  QTest::newRow("template-path-safety01") << QStringLiteral("visible_file")
-                                          << QStringLiteral("visible_file");
-  QTest::newRow("template-path-safety02") << QStringLiteral("../invisible_file")
-                                          << QString();
+  QTest::newRow("template-path-safety01")
+      << QStringLiteral("visible_file") << QStringLiteral("visible_file");
+  QTest::newRow("template-path-safety02")
+      << QStringLiteral("../invisible_file") << QString();
 }
 
 void TestBuiltinSyntax::testTemplatePathSafety()
@@ -1182,10 +1188,10 @@
   QTest::addColumn<QString>("inputPath");
   QTest::addColumn<QString>("output");
 
-  QTest::newRow("media-path-safety01") << QStringLiteral("visible_file")
-                                       << QStringLiteral("./visible_file");
-  QTest::newRow("media-path-safety02") << QStringLiteral("../invisible_file")
-                                       << QString();
+  QTest::newRow("media-path-safety01")
+      << QStringLiteral("visible_file") << QStringLiteral("./visible_file");
+  QTest::newRow("media-path-safety02")
+      << QStringLiteral("../invisible_file") << QString();
 }
 
 void TestBuiltinSyntax::testMediaPathSafety()
@@ -1261,12 +1267,17 @@
 
   dict.insert(QStringLiteral("hash"), itemsHash);
 
-  QTest::newRow("type-accessors-hash-unordered01")
-      << QStringLiteral("{% for key,value in hash.items %}{{ key }}:{{ value }};{% endfor %}")
-      << dict
-      << (QStringList() << QStringLiteral("one:1;") << QStringLiteral("two:2;")
-                        << QStringLiteral("three:3;"))
-      << NoError;
+  QTest::newRow("type-accessors-hash-unordered01") << QStringLiteral(
+      "{% for key,value in hash.items %}{{ key }}:{{ value }};{% endfor %}")
+                                                   << dict
+                                                   << (QStringList()
+                                                       << QStringLiteral(
+                                                              "one:1;")
+                                                       << QStringLiteral(
+                                                              "two:2;")
+                                                       << QStringLiteral(
+                                                              "three:3;"))
+                                                   << NoError;
   QTest::newRow("type-accessors-hash-unordered02")
       << QStringLiteral("{% for key in hash.keys %}{{ key }};{% endfor %}")
       << dict
@@ -1276,8 +1287,9 @@
   QTest::newRow("type-accessors-hash-unordered03")
       << QStringLiteral(
              "{% for value in hash.values %}{{ value }};{% endfor %}")
-      << dict << (QStringList() << QStringLiteral("1;") << QStringLiteral("2;")
-                                << QStringLiteral("3;"))
+      << dict
+      << (QStringList() << QStringLiteral("1;") << QStringLiteral("2;")
+                        << QStringLiteral("3;"))
       << NoError;
 }
 
@@ -1412,9 +1424,9 @@
   QTest::newRow("type-accessors-string20")
       << QStringLiteral("{{ str1.lower }}") << dict
       << QStringLiteral("my string") << NoError;
-  QTest::newRow("type-accessors-string21") << QStringLiteral("{{ str2.lower }}")
-                                           << dict << QStringLiteral("mystring")
-                                           << NoError;
+  QTest::newRow("type-accessors-string21")
+      << QStringLiteral("{{ str2.lower }}") << dict
+      << QStringLiteral("mystring") << NoError;
   QTest::newRow("type-accessors-string22")
       << QStringLiteral("{{ str3.lower }}") << dict
       << QStringLiteral("my string") << NoError;
@@ -1434,19 +1446,19 @@
   dict.insert(QStringLiteral("str4"), QStringLiteral("             "));
   dict.insert(QStringLiteral("str5"), QStringLiteral(""));
 
-  QTest::newRow("type-accessors-string24") << QStringLiteral("{{ str1.strip }}")
-                                           << dict << QStringLiteral("one")
-                                           << NoError;
-  QTest::newRow("type-accessors-string25") << QStringLiteral("{{ str2.strip }}")
-                                           << dict << QStringLiteral("one")
-                                           << NoError;
-  QTest::newRow("type-accessors-string26") << QStringLiteral("{{ str3.strip }}")
-                                           << dict << QStringLiteral("one")
-                                           << NoError;
-  QTest::newRow("type-accessors-string27") << QStringLiteral("{{ str4.strip }}")
-                                           << dict << QString() << NoError;
-  QTest::newRow("type-accessors-string28") << QStringLiteral("{{ str5.strip }}")
-                                           << dict << QString() << NoError;
+  QTest::newRow("type-accessors-string24")
+      << QStringLiteral("{{ str1.strip }}") << dict << QStringLiteral("one")
+      << NoError;
+  QTest::newRow("type-accessors-string25")
+      << QStringLiteral("{{ str2.strip }}") << dict << QStringLiteral("one")
+      << NoError;
+  QTest::newRow("type-accessors-string26")
+      << QStringLiteral("{{ str3.strip }}") << dict << QStringLiteral("one")
+      << NoError;
+  QTest::newRow("type-accessors-string27")
+      << QStringLiteral("{{ str4.strip }}") << dict << QString() << NoError;
+  QTest::newRow("type-accessors-string28")
+      << QStringLiteral("{{ str5.strip }}") << dict << QString() << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("str1"), QStringLiteral("My String"));
@@ -1484,9 +1496,9 @@
   QTest::newRow("type-accessors-string34")
       << QStringLiteral("{{ str1.title }}") << dict
       << QStringLiteral("My String") << NoError;
-  QTest::newRow("type-accessors-string35") << QStringLiteral("{{ str2.title }}")
-                                           << dict << QStringLiteral("Mystring")
-                                           << NoError;
+  QTest::newRow("type-accessors-string35")
+      << QStringLiteral("{{ str2.title }}") << dict
+      << QStringLiteral("Mystring") << NoError;
   QTest::newRow("type-accessors-string36")
       << QStringLiteral("{{ str3.title }}") << dict
       << QStringLiteral("My String") << NoError;
@@ -1500,14 +1512,14 @@
   QTest::newRow("type-accessors-string39")
       << QStringLiteral("{{ str1.upper }}") << dict
       << QStringLiteral("MY STRING") << NoError;
-  QTest::newRow("type-accessors-string40") << QStringLiteral("{{ str2.upper }}")
-                                           << dict << QStringLiteral("MYSTRING")
-                                           << NoError;
+  QTest::newRow("type-accessors-string40")
+      << QStringLiteral("{{ str2.upper }}") << dict
+      << QStringLiteral("MYSTRING") << NoError;
   QTest::newRow("type-accessors-string41")
       << QStringLiteral("{{ str3.upper }}") << dict
       << QStringLiteral("MY STRING") << NoError;
-  QTest::newRow("type-accessors-string42") << QStringLiteral("{{ str3.dne }}")
-                                           << dict << QString() << NoError;
+  QTest::newRow("type-accessors-string42")
+      << QStringLiteral("{{ str3.dne }}") << dict << QString() << NoError;
   QTest::newRow("type-accessors-string43")
       << QStringLiteral("{{ str2.isalpha }}") << dict << QStringLiteral("True")
       << NoError;
@@ -1583,9 +1595,9 @@
   dict.insert(QStringLiteral("var"),
               QVariant::fromValue(static_cast<QObject *>(obj)));
 
-  QTest::newRow("dynamic-properties01") << QStringLiteral("{{ var.prop }}")
-                                        << dict << QStringLiteral("7")
-                                        << NoError;
+  QTest::newRow("dynamic-properties01")
+      << QStringLiteral("{{ var.prop }}") << dict << QStringLiteral("7")
+      << NoError;
 }
 
 void TestBuiltinSyntax::testGarbageInput()
@@ -1849,28 +1861,36 @@
 
   // Consecutive trimmed lines with tags strips one newline each
   QTest::newRow("insignificant-whitespace20")
-      << QStringLiteral("\n{% templatetag openblock %}\n{% templatetag openblock %}\n{% templatetag openblock %}\n some text\n")
+      << QStringLiteral(
+             "\n{% templatetag openblock %}\n{% templatetag openblock %}\n{% "
+             "templatetag openblock %}\n some text\n")
       << dict << QStringLiteral("{%{%{%\n some text\n")
       << QStringLiteral("\n{%\n{%\n{%\n some text\n");
 
   // Consecutive trimmed lines with tags strips one newline each. Intermediate
   // newlines are preserved
   QTest::newRow("insignificant-whitespace21")
-      << QStringLiteral("\n\n{% templatetag openblock %}\n\n{% templatetag openblock %}\n\n{% templatetag openblock %}\n\n some text\n")
+      << QStringLiteral(
+             "\n\n{% templatetag openblock %}\n\n{% templatetag openblock "
+             "%}\n\n{% templatetag openblock %}\n\n some text\n")
       << dict << QStringLiteral("\n{%\n{%\n{%\n\n some text\n")
       << QStringLiteral("\n\n{%\n\n{%\n\n{%\n\n some text\n");
 
   // Consecutive trimmed lines with tags strips one newline each. Leading
   // whitespace is stripped but trailing is not
   QTest::newRow("insignificant-whitespace22")
-      << QStringLiteral("\n\n\t {% templatetag openblock %}\t \n\n\t {% templatetag openblock %}\t \n\n\t {% templatetag openblock %}\t \n some text\n")
+      << QStringLiteral("\n\n\t {% templatetag openblock %}\t \n\n\t {% "
+                        "templatetag openblock %}\t \n\n\t {% templatetag "
+                        "openblock %}\t \n some text\n")
       << dict << QStringLiteral("\n{%\t \n{%\t \n{%\t \n some text\n")
       << QStringLiteral("\n\n\t {%\t \n\n\t {%\t \n\n\t {%\t \n some text\n");
 
   // Consecutive trimmed lines with tags strips one newline each. Intermediate
   // whitespace is stripped
   QTest::newRow("insignificant-whitespace23")
-      << QStringLiteral("\n\t {% templatetag openblock %}\t \n\t {% templatetag openblock %}\t \n\t {% templatetag openblock %}\t \n some text\n")
+      << QStringLiteral(
+             "\n\t {% templatetag openblock %}\t \n\t {% templatetag openblock "
+             "%}\t \n\t {% templatetag openblock %}\t \n some text\n")
       << dict << QStringLiteral("{%\t {%\t {%\t \n some text\n")
       << QStringLiteral("\n\t {%\t \n\t {%\t \n\t {%\t \n some text\n");
 
@@ -1879,19 +1899,24 @@
   // leading
   // whitespace stripped
   QTest::newRow("insignificant-whitespace24")
-      << QStringLiteral("\n\t {% templatetag openblock %}\t \t {% templatetag openblock %}\t \t {% templatetag openblock %}\t \n some text\n")
+      << QStringLiteral(
+             "\n\t {% templatetag openblock %}\t \t {% templatetag openblock "
+             "%}\t \t {% templatetag openblock %}\t \n some text\n")
       << dict << QStringLiteral("\n\t {%\t \t {%\t \t {%\t \n some text\n")
       << QStringLiteral("\n\t {%\t \t {%\t \t {%\t \n some text\n");
 
   // Still, only one leading newline is removed.
   QTest::newRow("insignificant-whitespace25")
-      << QStringLiteral("\n\n {% templatetag openblock %}\n \t {% templatetag openblock %}\n \t {% templatetag openblock %}\n some text\n")
+      << QStringLiteral(
+             "\n\n {% templatetag openblock %}\n \t {% templatetag openblock "
+             "%}\n \t {% templatetag openblock %}\n some text\n")
       << dict << QStringLiteral("\n{%{%{%\n some text\n")
       << QStringLiteral("\n\n {%\n \t {%\n \t {%\n some text\n");
 
   // Lines with {# comments #} have the same stripping behavior
   QTest::newRow("insignificant-whitespace26")
-      << QStringLiteral("\n\n {% templatetag openblock %}\n \t {# some comment #}\n some text\n")
+      << QStringLiteral("\n\n {% templatetag openblock %}\n \t {# some comment "
+                        "#}\n some text\n")
       << dict << QStringLiteral("\n{%\n some text\n")
       << QStringLiteral("\n\n {%\n \t \n some text\n");
 
@@ -1904,31 +1929,38 @@
 
   // Consecutive newlines with tags and comments
   QTest::newRow("insignificant-whitespace28")
-      << QStringLiteral("\n\t {% templatetag openblock %}\t \n\t {# some comment #}\t \n\t {% templatetag openblock %}\t \n some text\n")
+      << QStringLiteral(
+             "\n\t {% templatetag openblock %}\t \n\t {# some comment #}\t "
+             "\n\t {% templatetag openblock %}\t \n some text\n")
       << dict << QStringLiteral("{%\t \t {%\t \n some text\n")
       << QStringLiteral("\n\t {%\t \n\t \t \n\t {%\t \n some text\n");
 
   dict.insert(QStringLiteral("spam"), QStringLiteral("ham"));
   // Lines with only {{ values }} have the same stripping behavior
   QTest::newRow("insignificant-whitespace29")
-      << QStringLiteral("\n {% templatetag openblock %}\t\n \t {{ spam }}\t \n \t {% templatetag openblock %}\t \n some text\n")
+      << QStringLiteral("\n {% templatetag openblock %}\t\n \t {{ spam }}\t \n "
+                        "\t {% templatetag openblock %}\t \n some text\n")
       << dict << QStringLiteral("{%\tham\t {%\t \n some text\n")
       << QStringLiteral("\n {%\t\n \t ham\t \n \t {%\t \n some text\n");
   QTest::newRow("insignificant-whitespace30")
-      << QStringLiteral("\n\n {% templatetag openblock %}\t\n\n \t {{ spam }}\t \n\n \t {% templatetag openblock %}\t \n some text\n")
+      << QStringLiteral(
+             "\n\n {% templatetag openblock %}\t\n\n \t {{ spam }}\t \n\n \t "
+             "{% templatetag openblock %}\t \n some text\n")
       << dict << QStringLiteral("\n{%\t\nham\t \n{%\t \n some text\n")
       << QStringLiteral("\n\n {%\t\n\n \t ham\t \n\n \t {%\t \n some text\n");
 
   // Leading whitespace not stripped when followed by anything. See
   // templatetag-whitespace24
   QTest::newRow("insignificant-whitespace31")
-      << QStringLiteral("\n {% templatetag openblock %}\t \t {{ spam }}\t \t {% templatetag openblock %}\t \n some text\n")
+      << QStringLiteral("\n {% templatetag openblock %}\t \t {{ spam }}\t \t "
+                        "{% templatetag openblock %}\t \n some text\n")
       << dict << QStringLiteral("\n {%\t \t ham\t \t {%\t \n some text\n")
       << QStringLiteral("\n {%\t \t ham\t \t {%\t \n some text\n");
 
   // {{ value }} {% tag %} {{ value }} this time
   QTest::newRow("insignificant-whitespace32")
-      << QStringLiteral("\n {{ spam }}\t\n \t {% templatetag openblock %}\t \n \t {{ spam }}\t \n some text\n")
+      << QStringLiteral("\n {{ spam }}\t\n \t {% templatetag openblock %}\t \n "
+                        "\t {{ spam }}\t \n some text\n")
       << dict << QStringLiteral("ham\t{%\t ham\t \n some text\n")
       << QStringLiteral("\n ham\t\n \t {%\t \n \t ham\t \n some text\n");
 
@@ -1938,8 +1970,9 @@
   QTest::newRow("insignificant-whitespace33")
       << QStringLiteral(
              "\n\n {# \n{% templatetag openblock #}\t \n some text\n")
-      << dict << QStringLiteral(
-                     "\n\n {# \n{% templatetag openblock #}\t \n some text\n")
+      << dict
+      << QStringLiteral(
+             "\n\n {# \n{% templatetag openblock #}\t \n some text\n")
       << QStringLiteral(
              "\n\n {# \n{% templatetag openblock #}\t \n some text\n");
 
@@ -1952,8 +1985,9 @@
   QTest::newRow("insignificant-whitespace35")
       << QStringLiteral(
              "\n\n {# \n{# templatetag openblock\n #}\t \n some text\n")
-      << dict << QStringLiteral(
-                     "\n\n {# \n{# templatetag openblock\n #}\t \n some text\n")
+      << dict
+      << QStringLiteral(
+             "\n\n {# \n{# templatetag openblock\n #}\t \n some text\n")
       << QStringLiteral(
              "\n\n {# \n{# templatetag openblock\n #}\t \n some text\n");
   QTest::newRow("insignificant-whitespace36")
@@ -1996,9 +2030,9 @@
       << QStringLiteral("\n{{# foo #};{# bar #}\n") << dict
       << QStringLiteral("\n{;\n") << QStringLiteral("\n{;\n");
 
-  QTest::newRow("insignificant-whitespace44") << QStringLiteral("\n{{ foo }} ")
-                                              << dict << QString()
-                                              << QStringLiteral("\n ");
+  QTest::newRow("insignificant-whitespace44")
+      << QStringLiteral("\n{{ foo }} ") << dict << QString()
+      << QStringLiteral("\n ");
 }
 
 QTEST_MAIN(TestBuiltinSyntax)
diff -Naur grantlee-5.1.0/templates/tests/testdefaulttags.cpp grantlee/templates/tests/testdefaulttags.cpp
--- grantlee-5.1.0/templates/tests/testdefaulttags.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/tests/testdefaulttags.cpp	2019-07-09 09:53:47.148090778 -0500
@@ -221,7 +221,8 @@
       << dict << QStringLiteral("hello") << NoError;
 
   QTest::newRow("comment-tag02")
-      << QStringLiteral("{% comment %}this is hidden{% endcomment %}hello{% comment %}foo{% endcomment %}")
+      << QStringLiteral("{% comment %}this is hidden{% endcomment %}hello{% "
+                        "comment %}foo{% endcomment %}")
       << dict << QStringLiteral("hello") << NoError;
   // Comment tag can contain invalid stuff.
   QTest::newRow("comment-tag03")
@@ -248,8 +249,8 @@
   dict.insert(QStringLiteral("a"), 0);
   dict.insert(QStringLiteral("b"), 0);
   dict.insert(QStringLiteral("c"), 0);
-  QTest::newRow("firstof01") << QStringLiteral("{% firstof a b c %}") << dict
-                             << QString() << NoError;
+  QTest::newRow("firstof01")
+      << QStringLiteral("{% firstof a b c %}") << dict << QString() << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("a"), 1);
@@ -287,8 +288,8 @@
 
   dict.clear();
   dict.insert(QStringLiteral("a"), 0);
-  QTest::newRow("firstof07") << "{% firstof a b \"c\" %}" << dict
-                             << QStringLiteral("c") << NoError;
+  QTest::newRow("firstof07")
+      << "{% firstof a b \"c\" %}" << dict << QStringLiteral("c") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("a"), 0);
@@ -319,6 +320,7 @@
   }
 
   bool isBadCalled() { return mIsBadCalled; }
+
 private:
   mutable bool mIsBadCalled;
 };
@@ -368,45 +370,46 @@
 
   dict.clear();
   dict.insert(QStringLiteral("foo"), true);
-  QTest::newRow("if-tag07")
-      << QStringLiteral(
-             "{% if foo %}foo{% elif bar %}bar{% else %}nothing{% endif %}")
-      << dict << QStringLiteral("foo") << NoError;
+  QTest::newRow("if-tag07") << QStringLiteral(
+      "{% if foo %}foo{% elif bar %}bar{% else %}nothing{% endif %}")
+                            << dict << QStringLiteral("foo") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("bar"), true);
-  QTest::newRow("if-tag08")
-      << QStringLiteral(
-             "{% if foo %}foo{% elif bar %}bar{% else %}nothing{% endif %}")
-      << dict << QStringLiteral("bar") << NoError;
+  QTest::newRow("if-tag08") << QStringLiteral(
+      "{% if foo %}foo{% elif bar %}bar{% else %}nothing{% endif %}")
+                            << dict << QStringLiteral("bar") << NoError;
 
   dict.clear();
-  QTest::newRow("if-tag09")
-      << QStringLiteral(
-             "{% if foo %}foo{% elif bar %}bar{% else %}nothing{% endif %}")
-      << dict << QStringLiteral("nothing") << NoError;
+  QTest::newRow("if-tag09") << QStringLiteral(
+      "{% if foo %}foo{% elif bar %}bar{% else %}nothing{% endif %}")
+                            << dict << QStringLiteral("nothing") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("foo"), true);
   QTest::newRow("if-tag10")
-      << QStringLiteral("{% if foo %}foo{% elif bar %}bar{% elif baz %}baz{% else %}nothing{% endif %}")
+      << QStringLiteral("{% if foo %}foo{% elif bar %}bar{% elif baz %}baz{% "
+                        "else %}nothing{% endif %}")
       << dict << QStringLiteral("foo") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("bar"), true);
   QTest::newRow("if-tag11")
-      << QStringLiteral("{% if foo %}foo{% elif bar %}bar{% elif baz %}baz{% else %}nothing{% endif %}")
+      << QStringLiteral("{% if foo %}foo{% elif bar %}bar{% elif baz %}baz{% "
+                        "else %}nothing{% endif %}")
       << dict << QStringLiteral("bar") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("baz"), true);
   QTest::newRow("if-tag12")
-      << QStringLiteral("{% if foo %}foo{% elif bar %}bar{% elif baz %}baz{% else %}nothing{% endif %}")
+      << QStringLiteral("{% if foo %}foo{% elif bar %}bar{% elif baz %}baz{% "
+                        "else %}nothing{% endif %}")
       << dict << QStringLiteral("baz") << NoError;
 
   dict.clear();
   QTest::newRow("if-tag13")
-      << QStringLiteral("{% if foo %}foo{% elif bar %}bar{% elif baz %}baz{% else %}nothing{% endif %}")
+      << QStringLiteral("{% if foo %}foo{% elif bar %}bar{% elif baz %}baz{% "
+                        "else %}nothing{% endif %}")
       << dict << QStringLiteral("nothing") << NoError;
 
   // Filters
@@ -418,10 +421,9 @@
       << dict << QStringLiteral("yes") << NoError;
 
   dict.clear();
-  QTest::newRow("if-tag-filter02")
-      << QStringLiteral(
-             "{% if foo|upper == \'ABC\' %}yes{% else %}no{% endif %}")
-      << dict << QStringLiteral("no") << NoError;
+  QTest::newRow("if-tag-filter02") << QStringLiteral(
+      "{% if foo|upper == \'ABC\' %}yes{% else %}no{% endif %}")
+                                   << dict << QStringLiteral("no") << NoError;
 
   // Equality
 
@@ -457,22 +459,23 @@
 
   dict.clear();
   dict.insert(QStringLiteral("foostring"), QStringLiteral("foo"));
-  QTest::newRow("if-tag-eq06")
-      << QStringLiteral("{% if foostring == \'foo\' %}yes{% else %}no{% endif %}")
-      << dict << QStringLiteral("yes") << NoError;
+  QTest::newRow("if-tag-eq06") << QStringLiteral(
+      "{% if foostring == \'foo\' %}yes{% else %}no{% endif %}")
+                               << dict << QStringLiteral("yes") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("foostring"), QStringLiteral("foo"));
-  QTest::newRow("if-tag-eq06")
-      << QStringLiteral("{% if foostring == \'foo\' %}yes{% else %}no{% endif %}")
-      << dict << QStringLiteral("yes") << NoError;
+  QTest::newRow("if-tag-eq06") << QStringLiteral(
+      "{% if foostring == \'foo\' %}yes{% else %}no{% endif %}")
+                               << dict << QStringLiteral("yes") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("zoo"), QVariant::fromValue(new Zoo(this)));
-  dict.insert(QStringLiteral("tigersEnum"), QVariant::fromValue<int>(Zoo::Tigers));
-  QTest::newRow("if-tag-eq07")
-      << QStringLiteral("{% if tigersEnum == zoo.Tigers %}yes{% else %}no{% endif %}")
-      << dict << QStringLiteral("yes") << NoError;
+  dict.insert(QStringLiteral("tigersEnum"),
+              QVariant::fromValue<int>(Zoo::Tigers));
+  QTest::newRow("if-tag-eq07") << QStringLiteral(
+      "{% if tigersEnum == zoo.Tigers %}yes{% else %}no{% endif %}")
+                               << dict << QStringLiteral("yes") << NoError;
 
   // Comparison
 
@@ -845,42 +848,37 @@
       << dict << QStringLiteral("yes") << NoError;
 
   dict.clear();
-  QTest::newRow("if-tag-not26")
-      << QStringLiteral(
-             "{% if not foo and not bar %}yes{% else %}no{% endif %}")
-      << dict << QStringLiteral("yes") << NoError;
+  QTest::newRow("if-tag-not26") << QStringLiteral(
+      "{% if not foo and not bar %}yes{% else %}no{% endif %}")
+                                << dict << QStringLiteral("yes") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("foo"), true);
   dict.insert(QStringLiteral("bar"), true);
-  QTest::newRow("if-tag-not27")
-      << QStringLiteral(
-             "{% if not foo and not bar %}yes{% else %}no{% endif %}")
-      << dict << QStringLiteral("no") << NoError;
+  QTest::newRow("if-tag-not27") << QStringLiteral(
+      "{% if not foo and not bar %}yes{% else %}no{% endif %}")
+                                << dict << QStringLiteral("no") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("foo"), true);
   dict.insert(QStringLiteral("bar"), false);
-  QTest::newRow("if-tag-not28")
-      << QStringLiteral(
-             "{% if not foo and not bar %}yes{% else %}no{% endif %}")
-      << dict << QStringLiteral("no") << NoError;
+  QTest::newRow("if-tag-not28") << QStringLiteral(
+      "{% if not foo and not bar %}yes{% else %}no{% endif %}")
+                                << dict << QStringLiteral("no") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("foo"), false);
   dict.insert(QStringLiteral("bar"), true);
-  QTest::newRow("if-tag-not29")
-      << QStringLiteral(
-             "{% if not foo and not bar %}yes{% else %}no{% endif %}")
-      << dict << QStringLiteral("no") << NoError;
+  QTest::newRow("if-tag-not29") << QStringLiteral(
+      "{% if not foo and not bar %}yes{% else %}no{% endif %}")
+                                << dict << QStringLiteral("no") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("foo"), false);
   dict.insert(QStringLiteral("bar"), false);
-  QTest::newRow("if-tag-not30")
-      << QStringLiteral(
-             "{% if not foo and not bar %}yes{% else %}no{% endif %}")
-      << dict << QStringLiteral("yes") << NoError;
+  QTest::newRow("if-tag-not30") << QStringLiteral(
+      "{% if not foo and not bar %}yes{% else %}no{% endif %}")
+                                << dict << QStringLiteral("yes") << NoError;
 
   dict.clear();
   QTest::newRow("if-tag-not31")
@@ -986,10 +984,9 @@
       << QStringLiteral("yes") << NoError;
 
   dict.clear();
-  QTest::newRow("if-tag-badarg04")
-      << QStringLiteral(
-             "{% if x|default_if_none:y %}yes{% else %}no{% endif %}")
-      << dict << QStringLiteral("no") << NoError;
+  QTest::newRow("if-tag-badarg04") << QStringLiteral(
+      "{% if x|default_if_none:y %}yes{% else %}no{% endif %}")
+                                   << dict << QStringLiteral("no") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("foo"), 1);
@@ -1083,10 +1080,9 @@
       << QStringLiteral("yes") << NoError;
 
   dict.clear();
-  QTest::newRow("if-tag-badarg04")
-      << QStringLiteral(
-             "{% if x|default_if_none:y %}yes{% else %}no{% endif %}")
-      << dict << QStringLiteral("no") << NoError;
+  QTest::newRow("if-tag-badarg04") << QStringLiteral(
+      "{% if x|default_if_none:y %}yes{% else %}no{% endif %}")
+                                   << dict << QStringLiteral("no") << NoError;
 }
 
 void TestDefaultTags::testForTag_data()
@@ -1109,10 +1105,9 @@
       << dict << QStringLiteral("321") << NoError;
   list.clear();
   dict.insert(QStringLiteral("values"), list);
-  QTest::newRow("for-tag03")
-      << QStringLiteral(
-             "{% for val in values %}({{ val }} sdfsdf,){% endfor %}")
-      << dict << QString() << NoError;
+  QTest::newRow("for-tag03") << QStringLiteral(
+      "{% for val in values %}({{ val }} sdfsdf,){% endfor %}")
+                             << dict << QString() << NoError;
   QStringList emails;
   emails << QStringLiteral("one") << QStringLiteral("two");
   QVariantHash obj;
@@ -1125,10 +1120,9 @@
   emails.clear();
   obj.insert(QStringLiteral("emails"), emails);
   dict.insert(QStringLiteral("contact"), obj);
-  QTest::newRow("for-tag05")
-      << QStringLiteral(
-             "{% for val in contact.emails %}({{ val }},){% endfor %}")
-      << dict << QString() << NoError;
+  QTest::newRow("for-tag05") << QStringLiteral(
+      "{% for val in contact.emails %}({{ val }},){% endfor %}")
+                             << dict << QString() << NoError;
   list.clear();
   dict.clear();
   emails << QStringLiteral("one");
@@ -1150,27 +1144,25 @@
 
   list << 1 << 2 << 3;
   dict.insert(QStringLiteral("values"), list);
-  QTest::newRow("for-tag-vars01")
-      << QStringLiteral(
-             "{% for val in values %}{{ forloop.counter }}{% endfor %}")
-      << dict << QStringLiteral("123") << NoError;
-  QTest::newRow("for-tag-vars02")
-      << QStringLiteral(
-             "{% for val in values %}{{ forloop.counter0 }}{% endfor %}")
-      << dict << QStringLiteral("012") << NoError;
-  QTest::newRow("for-tag-vars03")
-      << QStringLiteral(
-             "{% for val in values %}{{ forloop.revcounter }}{% endfor %}")
-      << dict << QStringLiteral("321") << NoError;
-  QTest::newRow("for-tag-vars04")
-      << QStringLiteral(
-             "{% for val in values %}{{ forloop.revcounter0 }}{% endfor %}")
-      << dict << QStringLiteral("210") << NoError;
+  QTest::newRow("for-tag-vars01") << QStringLiteral(
+      "{% for val in values %}{{ forloop.counter }}{% endfor %}")
+                                  << dict << QStringLiteral("123") << NoError;
+  QTest::newRow("for-tag-vars02") << QStringLiteral(
+      "{% for val in values %}{{ forloop.counter0 }}{% endfor %}")
+                                  << dict << QStringLiteral("012") << NoError;
+  QTest::newRow("for-tag-vars03") << QStringLiteral(
+      "{% for val in values %}{{ forloop.revcounter }}{% endfor %}")
+                                  << dict << QStringLiteral("321") << NoError;
+  QTest::newRow("for-tag-vars04") << QStringLiteral(
+      "{% for val in values %}{{ forloop.revcounter0 }}{% endfor %}")
+                                  << dict << QStringLiteral("210") << NoError;
   QTest::newRow("for-tag-vars05")
-      << QStringLiteral("{% for val in values %}{% if forloop.first %}f{% else %}x{% endif %}{% endfor %}")
+      << QStringLiteral("{% for val in values %}{% if forloop.first %}f{% else "
+                        "%}x{% endif %}{% endfor %}")
       << dict << QStringLiteral("fxx") << NoError;
   QTest::newRow("for-tag-vars06")
-      << QStringLiteral("{% for val in values %}{% if forloop.last %}l{% else %}x{% endif %}{% endfor %}")
+      << QStringLiteral("{% for val in values %}{% if forloop.last %}l{% else "
+                        "%}x{% endif %}{% endfor %}")
       << dict << QStringLiteral("xxl") << NoError;
 
   dict.clear();
@@ -1285,19 +1277,21 @@
 
   dict.clear();
   dict.insert(QStringLiteral("values"), QVariantList() << 1 << 2 << 3);
-  QTest::newRow("for-tag-empty01")
-      << QStringLiteral("{% for val in values %}{{ val }}{% empty %}empty text{% endfor %}")
-      << dict << QStringLiteral("123") << NoError;
+  QTest::newRow("for-tag-empty01") << QStringLiteral(
+      "{% for val in values %}{{ val }}{% empty %}empty text{% endfor %}")
+                                   << dict << QStringLiteral("123") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("values"), QVariantList());
   QTest::newRow("for-tag-empty02")
-      << QStringLiteral("{% for val in values %}{{ val }}{% empty %}values array empty{% endfor %}")
+      << QStringLiteral("{% for val in values %}{{ val }}{% empty %}values "
+                        "array empty{% endfor %}")
       << dict << QStringLiteral("values array empty") << NoError;
 
   dict.clear();
   QTest::newRow("for-tag-empty03")
-      << QStringLiteral("{% for val in values %}{{ val }}{% empty %}values array not found{% endfor %}")
+      << QStringLiteral("{% for val in values %}{{ val }}{% empty %}values "
+                        "array not found{% endfor %}")
       << dict << QStringLiteral("values array not found") << NoError;
 }
 
@@ -1383,10 +1377,9 @@
   QTest::newRow("ifequal-split03")
       << "{% ifequal a \"test man\" %}yes{% else %}no{% endifequal %}" << dict
       << QStringLiteral("yes") << NoError;
-  QTest::newRow("ifequal-split04")
-      << QStringLiteral(
-             "{% ifequal a 'test man' %}yes{% else %}no{% endifequal %}")
-      << dict << QStringLiteral("yes") << NoError;
+  QTest::newRow("ifequal-split04") << QStringLiteral(
+      "{% ifequal a 'test man' %}yes{% else %}no{% endifequal %}")
+                                   << dict << QStringLiteral("yes") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("a"), QStringLiteral(""));
@@ -1548,10 +1541,9 @@
   QTest::newRow("ifnotequal01")
       << QStringLiteral("{% ifnotequal a b %}yes{% endifnotequal %}") << dict
       << QStringLiteral("yes") << NoError;
-  QTest::newRow("ifnotequal03")
-      << QStringLiteral(
-             "{% ifnotequal a b %}yes{% else %}no{% endifnotequal %}")
-      << dict << QStringLiteral("yes") << NoError;
+  QTest::newRow("ifnotequal03") << QStringLiteral(
+      "{% ifnotequal a b %}yes{% else %}no{% endifnotequal %}")
+                                << dict << QStringLiteral("yes") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("a"), 1);
@@ -1560,10 +1552,9 @@
   QTest::newRow("ifnotequal02")
       << QStringLiteral("{% ifnotequal a b %}yes{% endifnotequal %}") << dict
       << QString() << NoError;
-  QTest::newRow("ifnotequal04")
-      << QStringLiteral(
-             "{% ifnotequal a b %}yes{% else %}no{% endifnotequal %}")
-      << dict << QStringLiteral("no") << NoError;
+  QTest::newRow("ifnotequal04") << QStringLiteral(
+      "{% ifnotequal a b %}yes{% else %}no{% endifnotequal %}")
+                                << dict << QStringLiteral("no") << NoError;
 }
 
 void TestDefaultTags::testTemplateTagTag_data()
@@ -1597,14 +1588,12 @@
   QTest::newRow("templatetag08")
       << QStringLiteral("{% templatetag closebrace %}") << dict
       << QStringLiteral("}") << NoError;
-  QTest::newRow("templatetag09")
-      << QStringLiteral(
-             "{% templatetag openbrace %}{% templatetag openbrace %}")
-      << dict << QStringLiteral("{{") << NoError;
-  QTest::newRow("templatetag10")
-      << QStringLiteral(
-             "{% templatetag closebrace %}{% templatetag closebrace %}")
-      << dict << QStringLiteral("}}") << NoError;
+  QTest::newRow("templatetag09") << QStringLiteral(
+      "{% templatetag openbrace %}{% templatetag openbrace %}")
+                                 << dict << QStringLiteral("{{") << NoError;
+  QTest::newRow("templatetag10") << QStringLiteral(
+      "{% templatetag closebrace %}{% templatetag closebrace %}")
+                                 << dict << QStringLiteral("}}") << NoError;
   QTest::newRow("templatetag11")
       << QStringLiteral("{% templatetag opencomment %}") << dict
       << QStringLiteral("{#") << NoError;
@@ -1625,10 +1614,12 @@
   QVariantHash hash;
   hash.insert(QStringLiteral("key"), 50);
   dict.insert(QStringLiteral("dict"), hash);
-  QTest::newRow("with01")
-      << QStringLiteral("{% with dict.key as key %}{{ key }}{% endwith %}")
-      << dict << QStringLiteral("50") << NoError;
-  QTest::newRow("with02") << QStringLiteral("{{ key }}{% with dict.key as key %}{{ key }}-{{ dict.key }}-{{ key }}{% endwith %}{{ key }}")
+  QTest::newRow("with01") << QStringLiteral(
+      "{% with dict.key as key %}{{ key }}{% endwith %}")
+                          << dict << QStringLiteral("50") << NoError;
+  QTest::newRow("with02") << QStringLiteral(
+      "{{ key }}{% with dict.key as key %}{{ key }}-{{ dict.key }}-{{ key }}{% "
+      "endwith %}{{ key }}")
                           << dict << QStringLiteral("50-50-50") << NoError;
   QTest::newRow("with-error01")
       << QStringLiteral("{% with dict.key xx key %}{{ key }}{% endwith %}")
@@ -1650,13 +1641,13 @@
   QTest::newRow("cycle01") << QStringLiteral("{% cycle a %}") << dict
                            << QString() << TagSyntaxError;
   QTest::newRow("cycle02") << QStringLiteral(
-                                  "{% cycle a,b,c as abc %}{% cycle abc %}")
+      "{% cycle a,b,c as abc %}{% cycle abc %}")
                            << dict << QStringLiteral("ab") << NoError;
-  QTest::newRow("cycle03")
-      << QStringLiteral(
-             "{% cycle a,b,c as abc %}{% cycle abc %}{% cycle abc %}")
-      << dict << QStringLiteral("abc") << NoError;
-  QTest::newRow("cycle04") << QStringLiteral("{% cycle a,b,c as abc %}{% cycle abc %}{% cycle abc %}{% cycle abc %}")
+  QTest::newRow("cycle03") << QStringLiteral(
+      "{% cycle a,b,c as abc %}{% cycle abc %}{% cycle abc %}")
+                           << dict << QStringLiteral("abc") << NoError;
+  QTest::newRow("cycle04") << QStringLiteral(
+      "{% cycle a,b,c as abc %}{% cycle abc %}{% cycle abc %}{% cycle abc %}")
                            << dict << QStringLiteral("abca") << NoError;
   QTest::newRow("cycle05") << QStringLiteral("{% cycle a %}") << dict
                            << QString() << TagSyntaxError;
@@ -1664,56 +1655,59 @@
   QTest::newRow("cycle06") << QStringLiteral("{% cycle a %}") << dict
                            << QString() << TagSyntaxError;
   QTest::newRow("cycle07") << QStringLiteral(
-                                  "{% cycle a,b,c as foo %}{% cycle bar %}")
+      "{% cycle a,b,c as foo %}{% cycle bar %}")
                            << dict << QString() << TagSyntaxError;
-  QTest::newRow("cycle08") << QStringLiteral("{% cycle a,b,c as foo %}{% cycle foo %}{{ foo }}{{ foo }}{% cycle foo %}{{ foo }}")
-                           << dict << QStringLiteral("abbbcc") << NoError;
+  QTest::newRow("cycle08") << QStringLiteral(
+      "{% cycle a,b,c as foo %}{% cycle foo %}{{ foo }}{{ foo }}{% cycle foo "
+      "%}{{ foo }}") << dict
+                           << QStringLiteral("abbbcc") << NoError;
 
   dict.insert(QStringLiteral("test"), QVariantList() << 0 << 1 << 2 << 3 << 4);
-  QTest::newRow("cycle09")
-      << QStringLiteral(
-             "{% for i in test %}{% cycle a,b %}{{ i }},{% endfor %}")
-      << dict << QStringLiteral("a0,b1,a2,b3,a4,") << NoError;
+  QTest::newRow("cycle09") << QStringLiteral(
+      "{% for i in test %}{% cycle a,b %}{{ i }},{% endfor %}")
+                           << dict << QStringLiteral("a0,b1,a2,b3,a4,")
+                           << NoError;
 
   dict.clear();
-  QTest::newRow("cycle10")
-      << QStringLiteral("{% cycle 'a' 'b' 'c' as abc %}{% cycle abc %}") << dict
-      << QStringLiteral("ab") << NoError;
-  QTest::newRow("cycle11")
-      << QStringLiteral(
-             "{% cycle 'a' 'b' 'c' as abc %}{% cycle abc %}{% cycle abc %}")
-      << dict << QStringLiteral("abc") << NoError;
-  QTest::newRow("cycle12") << QStringLiteral("{% cycle 'a' 'b' 'c' as abc %}{% cycle abc %}{% cycle abc %}{% cycle abc %}")
-                           << dict << QStringLiteral("abca") << NoError;
+  QTest::newRow("cycle10") << QStringLiteral(
+      "{% cycle 'a' 'b' 'c' as abc %}{% cycle abc %}")
+                           << dict << QStringLiteral("ab") << NoError;
+  QTest::newRow("cycle11") << QStringLiteral(
+      "{% cycle 'a' 'b' 'c' as abc %}{% cycle abc %}{% cycle abc %}")
+                           << dict << QStringLiteral("abc") << NoError;
+  QTest::newRow("cycle12") << QStringLiteral(
+      "{% cycle 'a' 'b' 'c' as abc %}{% cycle abc %}{% cycle abc %}{% cycle "
+      "abc %}") << dict << QStringLiteral("abca")
+                           << NoError;
 
   dict.insert(QStringLiteral("test"), QVariantList() << 0 << 1 << 2 << 3 << 4);
-  QTest::newRow("cycle13")
-      << QStringLiteral(
-             "{% for i in test %}{% cycle 'a' 'b' %}{{ i }},{% endfor %}")
-      << dict << QStringLiteral("a0,b1,a2,b3,a4,") << NoError;
+  QTest::newRow("cycle13") << QStringLiteral(
+      "{% for i in test %}{% cycle 'a' 'b' %}{{ i }},{% endfor %}")
+                           << dict << QStringLiteral("a0,b1,a2,b3,a4,")
+                           << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("one"), QStringLiteral("1"));
   dict.insert(QStringLiteral("two"), QStringLiteral("2"));
   QTest::newRow("cycle14") << QStringLiteral(
-                                  "{% cycle one two as foo %}{% cycle foo %}")
+      "{% cycle one two as foo %}{% cycle foo %}")
                            << dict << QStringLiteral("12") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("test"), QVariantList() << 0 << 1 << 2 << 3 << 4);
   dict.insert(QStringLiteral("aye"), QStringLiteral("a"));
   dict.insert(QStringLiteral("bee"), QStringLiteral("b"));
-  QTest::newRow("cycle15")
-      << QStringLiteral(
-             "{% for i in test %}{% cycle aye bee %}{{ i }},{% endfor %}")
-      << dict << QStringLiteral("a0,b1,a2,b3,a4,") << NoError;
+  QTest::newRow("cycle15") << QStringLiteral(
+      "{% for i in test %}{% cycle aye bee %}{{ i }},{% endfor %}")
+                           << dict << QStringLiteral("a0,b1,a2,b3,a4,")
+                           << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("one"), QStringLiteral("A"));
   dict.insert(QStringLiteral("two"), QStringLiteral("2"));
-  QTest::newRow("cycle16")
-      << QStringLiteral("{% cycle one|lower two as foo %}{% cycle foo %}")
-      << dict << QStringLiteral("a2") << NoError;
+  QTest::newRow("cycle16") << QStringLiteral(
+      "{% cycle one|lower two as foo %}{% cycle foo %}")
+                           << dict << QStringLiteral("a2") << NoError;
 
   QTest::newRow("cycle17") << QStringLiteral("{% cycle %}") << dict << QString()
                            << TagSyntaxError;
@@ -1725,10 +1719,9 @@
 
   QTest::newRow("cycle19") << QStringLiteral("{% cycle one two three foo %}")
                            << dict << QStringLiteral("A") << NoError;
-  QTest::newRow("cycle20")
-      << QStringLiteral(
-             "{% cycle one two as foo %}{% cycle three four as bar %}")
-      << dict << QStringLiteral("AB") << NoError;
+  QTest::newRow("cycle20") << QStringLiteral(
+      "{% cycle one two as foo %}{% cycle three four as bar %}")
+                           << dict << QStringLiteral("AB") << NoError;
 }
 
 void TestDefaultTags::testWidthRatioTag_data()
@@ -1876,11 +1869,14 @@
              "{% spaceless %}<b>  <i>{{ text }}</i>  </b>{% endspaceless %}")
       << dict << QStringLiteral("<b><i>This &amp; that</i></b>") << NoError;
   QTest::newRow("spaceless05")
-      << QStringLiteral("{% autoescape off %}{% spaceless %}<b>  <i>{{ text }}</i>  </b>{% endspaceless %}{% endautoescape %}")
-      << dict << QStringLiteral("<b><i>This & that</i></b>") << NoError;
-  QTest::newRow("spaceless06")
-      << QStringLiteral("{% spaceless %}<b>  <i>{{ text|safe }}</i>  </b>{% endspaceless %}")
+      << QStringLiteral("{% autoescape off %}{% spaceless %}<b>  <i>{{ text "
+                        "}}</i>  </b>{% endspaceless %}{% endautoescape %}")
       << dict << QStringLiteral("<b><i>This & that</i></b>") << NoError;
+  QTest::newRow("spaceless06") << QStringLiteral(
+      "{% spaceless %}<b>  <i>{{ text|safe }}</i>  </b>{% endspaceless %}")
+                               << dict
+                               << QStringLiteral("<b><i>This & that</i></b>")
+                               << NoError;
 }
 
 void TestDefaultTags::testRegroupTag_data()
@@ -2027,50 +2023,57 @@
   Dict dict;
 
   dict.insert(QStringLiteral("num"), QVariantList() << 1 << 2 << 3);
-  QTest::newRow("ifchanged01")
-      << QStringLiteral("{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% endfor %}")
-      << dict << QStringLiteral("123") << NoError;
+  QTest::newRow("ifchanged01") << QStringLiteral(
+      "{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% endfor %}")
+                               << dict << QStringLiteral("123") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("num"), QVariantList() << 1 << 1 << 3);
-  QTest::newRow("ifchanged02")
-      << QStringLiteral("{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% endfor %}")
-      << dict << QStringLiteral("13") << NoError;
+  QTest::newRow("ifchanged02") << QStringLiteral(
+      "{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% endfor %}")
+                               << dict << QStringLiteral("13") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("num"), QVariantList() << 1 << 1 << 1);
-  QTest::newRow("ifchanged03")
-      << QStringLiteral("{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% endfor %}")
-      << dict << QStringLiteral("1") << NoError;
+  QTest::newRow("ifchanged03") << QStringLiteral(
+      "{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% endfor %}")
+                               << dict << QStringLiteral("1") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("num"), QVariantList() << 1 << 2 << 3);
   dict.insert(QStringLiteral("numx"), QVariantList() << 2 << 2 << 2);
-  QTest::newRow("ifchanged04")
-      << QStringLiteral("{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% for x in numx %}{% ifchanged %}{{ x }}{% endifchanged %}{% endfor %}{% endfor %}")
-      << dict << QStringLiteral("122232") << NoError;
+  QTest::newRow("ifchanged04") << QStringLiteral(
+      "{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% for x in "
+      "numx %}{% ifchanged %}{{ x }}{% endifchanged %}{% endfor %}{% endfor %}")
+                               << dict << QStringLiteral("122232") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("num"), QVariantList() << 1 << 1 << 1);
   dict.insert(QStringLiteral("numx"), QVariantList() << 1 << 2 << 3);
-  QTest::newRow("ifchanged05")
-      << QStringLiteral("{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% for x in numx %}{% ifchanged %}{{ x }}{% endifchanged %}{% endfor %}{% endfor %}")
-      << dict << QStringLiteral("1123123123") << NoError;
+  QTest::newRow("ifchanged05") << QStringLiteral(
+      "{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% for x in "
+      "numx %}{% ifchanged %}{{ x }}{% endifchanged %}{% endfor %}{% endfor %}")
+                               << dict << QStringLiteral("1123123123")
+                               << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("num"), QVariantList() << 1 << 1 << 1);
   dict.insert(QStringLiteral("numx"), QVariantList() << 2 << 2 << 2);
-  QTest::newRow("ifchanged06")
-      << QStringLiteral("{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% for x in numx %}{% ifchanged %}{{ x }}{% endifchanged %}{% endfor %}{% endfor %}")
-      << dict << QStringLiteral("1222") << NoError;
+  QTest::newRow("ifchanged06") << QStringLiteral(
+      "{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% for x in "
+      "numx %}{% ifchanged %}{{ x }}{% endifchanged %}{% endfor %}{% endfor %}")
+                               << dict << QStringLiteral("1222") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("num"), QVariantList() << 1 << 1 << 1);
   dict.insert(QStringLiteral("numx"), QVariantList() << 2 << 2 << 2);
   dict.insert(QStringLiteral("numy"), QVariantList() << 3 << 3 << 3);
-  QTest::newRow("ifchanged07")
-      << QStringLiteral("{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% for x in numx %}{% ifchanged %}{{ x }}{% endifchanged %}{% for y in numy %}{% ifchanged %}{{ y }}{% endifchanged %}{% endfor %}{% endfor %}{% endfor %}")
-      << dict << QStringLiteral("1233323332333") << NoError;
+  QTest::newRow("ifchanged07") << QStringLiteral(
+      "{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% for x in "
+      "numx %}{% ifchanged %}{{ x }}{% endifchanged %}{% for y in numy %}{% "
+      "ifchanged %}{{ y }}{% endifchanged %}{% endfor %}{% endfor %}{% endfor "
+      "%}") << dict << QStringLiteral("1233323332333")
+                               << NoError;
   QTest::newRow("ifchanged08")
       << QStringLiteral("{% ifchanged %}{{ num.0 }}{% endifchanged %}") << dict
       << QStringLiteral("1") << NoError;
@@ -2116,22 +2119,25 @@
   innerList.clear();
 
   dict.insert(QStringLiteral("datalist"), list);
-  QTest::newRow("ifchanged08")
-      << QStringLiteral("{% for data in datalist %}{% for c,d in data %}{% if c %}{% ifchanged %}{{ d }}{% endifchanged %}{% endif %}{% endfor %}{% endfor %}")
-      << dict << QStringLiteral("accd") << NoError;
+  QTest::newRow("ifchanged08") << QStringLiteral(
+      "{% for data in datalist %}{% for c,d in data %}{% if c %}{% ifchanged "
+      "%}{{ d }}{% endifchanged %}{% endif %}{% endfor %}{% endfor %}")
+                               << dict << QStringLiteral("accd") << NoError;
 
   // Test one parameter given to ifchanged.
   dict.clear();
   dict.insert(QStringLiteral("num"), QVariantList() << 1 << 2 << 3);
   QTest::newRow("ifchanged-param01")
-      << QStringLiteral("{% for n in num %}{% ifchanged n %}..{% endifchanged %}{{ n }}{% endfor %}")
+      << QStringLiteral("{% for n in num %}{% ifchanged n %}..{% endifchanged "
+                        "%}{{ n }}{% endfor %}")
       << dict << QStringLiteral("..1..2..3") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("num"), QVariantList() << 1 << 2 << 3);
   dict.insert(QStringLiteral("numx"), QVariantList() << 5 << 6 << 7);
   QTest::newRow("ifchanged-param02")
-      << QStringLiteral("{% for n in num %}{% for x in numx %}{% ifchanged n %}..{% endifchanged %}{{ x }}{% endfor %}{% endfor %}")
+      << QStringLiteral("{% for n in num %}{% for x in numx %}{% ifchanged n "
+                        "%}..{% endifchanged %}{{ x }}{% endfor %}{% endfor %}")
       << dict << QStringLiteral("..567..567..567") << NoError;
 
   // Test multiple parameters to ifchanged.
@@ -2140,7 +2146,9 @@
   dict.insert(QStringLiteral("num"), QVariantList() << 1 << 1 << 2);
   dict.insert(QStringLiteral("numx"), QVariantList() << 5 << 6 << 6);
   QTest::newRow("ifchanged-param03")
-      << QStringLiteral("{% for n in num %}{{ n }}{% for x in numx %}{% ifchanged x n %}{{ x }}{% endifchanged %}{% endfor %}{% endfor %}")
+      << QStringLiteral(
+             "{% for n in num %}{{ n }}{% for x in numx %}{% ifchanged x n "
+             "%}{{ x }}{% endifchanged %}{% endfor %}{% endfor %}")
       << dict << QStringLiteral("156156256") << NoError;
 
   // Test a date+hour like construct, where the hour of the last day
@@ -2158,38 +2166,49 @@
   days << hash;
   dict.insert(QStringLiteral("days"), days);
   QTest::newRow("ifchanged-param04")
-      << QStringLiteral("{% for d in days %}{% ifchanged %}{{ d.day }}{% endifchanged %}{% for h in d.hours %}{% ifchanged d h %}{{ h }}{% endifchanged %}{% endfor %}{% endfor %}")
+      << QStringLiteral("{% for d in days %}{% ifchanged %}{{ d.day }}{% "
+                        "endifchanged %}{% for h in d.hours %}{% ifchanged d h "
+                        "%}{{ h }}{% endifchanged %}{% endfor %}{% endfor %}")
       << dict << QStringLiteral("112323") << NoError;
 
   // Logically the same as above, just written with explicit
   // ifchanged for the day.
 
-  QTest::newRow("ifchanged-param05")
-      << QStringLiteral("{% for d in days %}{% ifchanged d.day %}{{ d.day }}{% endifchanged %}{% for h in d.hours %}{% ifchanged d.day h %}{{ h }}{% endifchanged %}{% endfor %}{% endfor %}")
-      << dict << QStringLiteral("112323") << NoError;
+  QTest::newRow("ifchanged-param05") << QStringLiteral(
+      "{% for d in days %}{% ifchanged d.day %}{{ d.day }}{% endifchanged %}{% "
+      "for h in d.hours %}{% ifchanged d.day h %}{{ h }}{% endifchanged %}{% "
+      "endfor %}{% endfor %}") << dict
+                                     << QStringLiteral("112323") << NoError;
 
   // Test the else clause of ifchanged.
   dict.clear();
-  dict.insert(QStringLiteral("ids"), QVariantList() << 1 << 1 << 2 << 2 << 2
-                                                    << 3);
+  dict.insert(QStringLiteral("ids"), QVariantList()
+                                         << 1 << 1 << 2 << 2 << 2 << 3);
   QTest::newRow("ifchanged-else01")
-      << QStringLiteral("{% for id in ids %}{{ id }}{% ifchanged id %}-first{% else %}-other{% endifchanged %},{% endfor %}")
+      << QStringLiteral("{% for id in ids %}{{ id }}{% ifchanged id %}-first{% "
+                        "else %}-other{% endifchanged %},{% endfor %}")
       << dict
       << QStringLiteral("1-first,1-other,2-first,2-other,2-other,3-first,")
       << NoError;
   QTest::newRow("ifchanged-else02")
-      << QStringLiteral("{% for id in ids %}{{ id }}-{% ifchanged id %}{% cycle red,blue %}{% else %}grey{% endifchanged %},{% endfor %}")
+      << QStringLiteral(
+             "{% for id in ids %}{{ id }}-{% ifchanged id %}{% cycle red,blue "
+             "%}{% else %}grey{% endifchanged %},{% endfor %}")
       << dict << QStringLiteral("1-red,1-grey,2-blue,2-grey,2-grey,3-red,")
       << NoError;
   QTest::newRow("ifchanged-else03")
-      << QStringLiteral("{% for id in ids %}{{ id }}{% ifchanged id %}-{% cycle red,blue %}{% else %}{% endifchanged %},{% endfor %}")
+      << QStringLiteral(
+             "{% for id in ids %}{{ id }}{% ifchanged id %}-{% cycle red,blue "
+             "%}{% else %}{% endifchanged %},{% endfor %}")
       << dict << QStringLiteral("1-red,1,2-blue,2,2,3-red,") << NoError;
 
   dict.clear();
-  dict.insert(QStringLiteral("ids"), QVariantList() << 1 << 1 << 2 << 2 << 2
-                                                    << 3 << 4);
+  dict.insert(QStringLiteral("ids"), QVariantList()
+                                         << 1 << 1 << 2 << 2 << 2 << 3 << 4);
   QTest::newRow("ifchanged-else04")
-      << QStringLiteral("{% for id in ids %}{% ifchanged %}***{{ id }}*{% else %}...{% endifchanged %}{{ forloop.counter }}{% endfor %}")
+      << QStringLiteral(
+             "{% for id in ids %}{% ifchanged %}***{{ id }}*{% else %}...{% "
+             "endifchanged %}{{ forloop.counter }}{% endfor %}")
       << dict << QStringLiteral("***1*1...2***2*3...4...5***3*6***4*7")
       << NoError;
 }
@@ -2217,7 +2236,8 @@
   // Autoescape disabling and enabling nest in a predictable way.
   dict.insert(QStringLiteral("first"), QStringLiteral("<a>"));
   QTest::newRow("autoescape-tag04")
-      << QStringLiteral("{% autoescape off %}{{ first }} {% autoescape  on%}{{ first }}{% endautoescape %}{% endautoescape %}")
+      << QStringLiteral("{% autoescape off %}{{ first }} {% autoescape  on%}{{ "
+                        "first }}{% endautoescape %}{% endautoescape %}")
       << dict << QStringLiteral("<a> &lt;a&gt;") << NoError;
 
   dict.insert(QStringLiteral("first"), QStringLiteral("<b>first</b>"));
@@ -2230,9 +2250,9 @@
   auto safeStringVar = QVariant::fromValue<SafeString>(markSafe(safeString));
   dict.insert(QStringLiteral("first"), safeStringVar);
 
-  QTest::newRow("autoescape-tag06") << QStringLiteral("{{ first }}") << dict
-                                    << QStringLiteral("<b>first</b>")
-                                    << NoError;
+  QTest::newRow("autoescape-tag06")
+      << QStringLiteral("{{ first }}") << dict << QStringLiteral("<b>first</b>")
+      << NoError;
   QTest::newRow("autoescape-tag07")
       << QStringLiteral("{% autoescape on %}{{ first }}{% endautoescape %}")
       << dict << QStringLiteral("<b>first</b>") << NoError;
@@ -2372,9 +2392,10 @@
   list << 10 << 15 << 2;
   dict.insert(QStringLiteral("values"), list);
 
-  QTest::newRow("range-tag04")
-      << QStringLiteral("{% range values.0 values.1 values.2 as i %}{{ i }};{% endrange %}")
-      << dict << QStringLiteral("10;12;14;") << NoError;
+  QTest::newRow("range-tag04") << QStringLiteral(
+      "{% range values.0 values.1 values.2 as i %}{{ i }};{% endrange %}")
+                               << dict << QStringLiteral("10;12;14;")
+                               << NoError;
 
   QTest::newRow("range-tag05")
       << QStringLiteral("{% range 5 %}Foo;{% endrange %}") << dict
diff -Naur grantlee-5.1.0/templates/tests/testfilters.cpp grantlee/templates/tests/testfilters.cpp
--- grantlee-5.1.0/templates/tests/testfilters.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/tests/testfilters.cpp	2019-07-09 09:53:47.149090758 -0500
@@ -84,7 +84,7 @@
   m_engine->setPluginPaths(
       QStringList() << QStringLiteral(GRANTLEE_PLUGIN_PATH)
                     << appDirPath + QStringLiteral("/tests/") // For testtags.qs
-      );
+  );
 }
 
 void TestFilters::cleanupTestCase() { delete m_engine; }
@@ -129,17 +129,17 @@
 
   dict.insert(QStringLiteral("a"), now.addSecs(-70));
 
-  QTest::newRow("filter-timesince01") << QStringLiteral("{{ a|timesince }}")
-                                      << dict << QStringLiteral("1 minute")
-                                      << NoError;
+  QTest::newRow("filter-timesince01")
+      << QStringLiteral("{{ a|timesince }}") << dict
+      << QStringLiteral("1 minute") << NoError;
 
   dict.clear();
 
   dict.insert(QStringLiteral("a"), now.addDays(-1).addSecs(-60));
 
-  QTest::newRow("filter-timesince02") << QStringLiteral("{{ a|timesince }}")
-                                      << dict << QStringLiteral("1 day")
-                                      << NoError;
+  QTest::newRow("filter-timesince02")
+      << QStringLiteral("{{ a|timesince }}") << dict << QStringLiteral("1 day")
+      << NoError;
 
   dict.clear();
 
@@ -156,18 +156,18 @@
   dict.insert(QStringLiteral("a"), now.addDays(-2));
   dict.insert(QStringLiteral("b"), now.addDays(-1));
 
-  QTest::newRow("filter-timesince04") << QStringLiteral("{{ a|timesince:b }}")
-                                      << dict << QStringLiteral("1 day")
-                                      << NoError;
+  QTest::newRow("filter-timesince04")
+      << QStringLiteral("{{ a|timesince:b }}") << dict
+      << QStringLiteral("1 day") << NoError;
 
   dict.clear();
 
   dict.insert(QStringLiteral("a"), now.addDays(-2).addSecs(-60));
   dict.insert(QStringLiteral("b"), now.addDays(-2));
 
-  QTest::newRow("filter-timesince05") << QStringLiteral("{{ a|timesince:b }}")
-                                      << dict << QStringLiteral("1 minute")
-                                      << NoError;
+  QTest::newRow("filter-timesince05")
+      << QStringLiteral("{{ a|timesince:b }}") << dict
+      << QStringLiteral("1 minute") << NoError;
 
   dict.clear();
 
@@ -196,9 +196,9 @@
 
   dict.insert(QStringLiteral("later"), now.addDays(7));
 
-  QTest::newRow("filter-timesince09") << QStringLiteral("{{ later|timesince }}")
-                                      << dict << QStringLiteral("0 minutes")
-                                      << NoError;
+  QTest::newRow("filter-timesince09")
+      << QStringLiteral("{{ later|timesince }}") << dict
+      << QStringLiteral("0 minutes") << NoError;
 
   dict.clear();
 
@@ -244,34 +244,40 @@
   dict.insert(QStringLiteral("a"), now);
   dict.insert(QStringLiteral("b"), now);
 
-  QTest::newRow("filter-timesince17") << QStringLiteral("{{ a|timesince:b }}")
-                                      << dict << QStringLiteral("0 minutes")
-                                      << NoError;
+  QTest::newRow("filter-timesince17")
+      << QStringLiteral("{{ a|timesince:b }}") << dict
+      << QStringLiteral("0 minutes") << NoError;
 
   dict.clear();
 
   dict.insert(QStringLiteral("a"), now);
   dict.insert(QStringLiteral("b"), now.addDays(1));
 
-  QTest::newRow("filter-timesince18") << QStringLiteral("{{ a|timesince:b }}")
-                                      << dict << QStringLiteral("1 day")
-                                      << NoError;
+  QTest::newRow("filter-timesince18")
+      << QStringLiteral("{{ a|timesince:b }}") << dict
+      << QStringLiteral("1 day") << NoError;
+
+  dict.clear();
+  QTest::newRow("filter-timesince19") << QStringLiteral("{{xx|timesince}}")
+                                      << dict << QStringLiteral("") << NoError;
+  QTest::newRow("filter-timesince20") << QStringLiteral("{{|timesince}}")
+                                      << dict << QStringLiteral("") << NoError;
 
   //  Default compare with datetime.now()
 
   dict.clear();
   dict.insert(QStringLiteral("a"), now.addSecs(130));
 
-  QTest::newRow("filter-timeuntil01") << QStringLiteral("{{ a|timeuntil }}")
-                                      << dict << QStringLiteral("2 minutes")
-                                      << NoError;
+  QTest::newRow("filter-timeuntil01")
+      << QStringLiteral("{{ a|timeuntil }}") << dict
+      << QStringLiteral("2 minutes") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("a"), now.addDays(1).addSecs(10));
 
-  QTest::newRow("filter-timeuntil02") << QStringLiteral("{{ a|timeuntil }}")
-                                      << dict << QStringLiteral("1 day")
-                                      << NoError;
+  QTest::newRow("filter-timeuntil02")
+      << QStringLiteral("{{ a|timeuntil }}") << dict << QStringLiteral("1 day")
+      << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("a"), now.addSecs(60 * 60 * 8).addSecs(610));
@@ -286,17 +292,17 @@
   dict.insert(QStringLiteral("a"), now.addDays(-1));
   dict.insert(QStringLiteral("b"), now.addDays(-2));
 
-  QTest::newRow("filter-timeuntil04") << QStringLiteral("{{ a|timeuntil:b }}")
-                                      << dict << QStringLiteral("1 day")
-                                      << NoError;
+  QTest::newRow("filter-timeuntil04")
+      << QStringLiteral("{{ a|timeuntil:b }}") << dict
+      << QStringLiteral("1 day") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("a"), now.addDays(-1));
   dict.insert(QStringLiteral("b"), now.addDays(-1).addSecs(-60));
 
-  QTest::newRow("filter-timeuntil05") << QStringLiteral("{{ a|timeuntil:b }}")
-                                      << dict << QStringLiteral("1 minute")
-                                      << NoError;
+  QTest::newRow("filter-timeuntil05")
+      << QStringLiteral("{{ a|timeuntil:b }}") << dict
+      << QStringLiteral("1 minute") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("earlier"), now.addDays(-7));
@@ -316,9 +322,9 @@
   dict.clear();
   dict.insert(QStringLiteral("later"), now.addDays(7).addSecs(5));
 
-  QTest::newRow("filter-timeuntil08") << QStringLiteral("{{ later|timeuntil }}")
-                                      << dict << QStringLiteral("1 week")
-                                      << NoError;
+  QTest::newRow("filter-timeuntil08")
+      << QStringLiteral("{{ later|timeuntil }}") << dict
+      << QStringLiteral("1 week") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("now"), now);
@@ -343,17 +349,23 @@
   dict.clear();
   dict.insert(QStringLiteral("a"), now);
   dict.insert(QStringLiteral("b"), now);
-  QTest::newRow("filter-timeuntil12") << QStringLiteral("{{ a|timeuntil:b }}")
-                                      << dict << QStringLiteral("0 minutes")
-                                      << NoError;
+  QTest::newRow("filter-timeuntil12")
+      << QStringLiteral("{{ a|timeuntil:b }}") << dict
+      << QStringLiteral("0 minutes") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("a"), now);
   dict.insert(QStringLiteral("b"), now.addDays(-1));
 
-  QTest::newRow("filter-timeuntil13") << QStringLiteral("{{ a|timeuntil:b }}")
-                                      << dict << QStringLiteral("1 day")
-                                      << NoError;
+  QTest::newRow("filter-timeuntil13")
+      << QStringLiteral("{{ a|timeuntil:b }}") << dict
+      << QStringLiteral("1 day") << NoError;
+
+  dict.clear();
+  QTest::newRow("filter-timeuntil14") << QStringLiteral("{{xx|timeuntil}}")
+                                      << dict << QStringLiteral("") << NoError;
+  QTest::newRow("filter-timeuntil15") << QStringLiteral("{{|timeuntil}}")
+                                      << dict << QStringLiteral("") << NoError;
 
   QDateTime d(QDate(2008, 1, 1));
 
@@ -387,7 +399,8 @@
               QVariant::fromValue(markSafe(QStringLiteral("<a>\'"))));
 
   QTest::newRow("filter-addslash01")
-      << QStringLiteral("{% autoescape off %}{{ a|addslashes }} {{ b|addslashes }}{% endautoescape %}")
+      << QStringLiteral("{% autoescape off %}{{ a|addslashes }} {{ "
+                        "b|addslashes }}{% endautoescape %}")
       << dict << "<a>\\\' <a>\\\'" << NoError;
 
   dict.clear();
@@ -405,7 +418,8 @@
               QVariant::fromValue(markSafe(QStringLiteral("fred&gt;"))));
 
   QTest::newRow("filter-capfirst01")
-      << QStringLiteral("{% autoescape off %}{{ a|capfirst }} {{ b|capfirst }}{% endautoescape %}")
+      << QStringLiteral("{% autoescape off %}{{ a|capfirst }} {{ b|capfirst "
+                        "}}{% endautoescape %}")
       << dict << QStringLiteral("Fred> Fred&gt;") << NoError;
 
   dict.clear();
@@ -426,7 +440,8 @@
               QVariant::fromValue(markSafe(QStringLiteral("a&b"))));
 
   QTest::newRow("filter-fix_ampersands01")
-      << QStringLiteral("{% autoescape off %}{{ a|fix_ampersands }} {{ b|fix_ampersands }}{% endautoescape %}")
+      << QStringLiteral("{% autoescape off %}{{ a|fix_ampersands }} {{ "
+                        "b|fix_ampersands }}{% endautoescape %}")
       << dict << QStringLiteral("a&amp;b a&amp;b") << NoError;
 
   dict.clear();
@@ -444,7 +459,8 @@
               QVariant::fromValue(markSafe(QStringLiteral("1.42"))));
 
   QTest::newRow("filter-floatformat01")
-      << QStringLiteral("{% autoescape off %}{{ a|floatformat }} {{ b|floatformat }}{% endautoescape %}")
+      << QStringLiteral("{% autoescape off %}{{ a|floatformat }} {{ "
+                        "b|floatformat }}{% endautoescape %}")
       << dict << QStringLiteral("1.4 1.4") << NoError;
 
   dict.clear();
@@ -476,7 +492,8 @@
       QStringLiteral("b"),
       QVariant::fromValue(markSafe(QStringLiteral("one\n&lt;two&gt;\nthree"))));
   QTest::newRow("filter-linenumbers02")
-      << QStringLiteral("{% autoescape off %}{{ a|linenumbers }} {{ b|linenumbers }}{% endautoescape %}")
+      << QStringLiteral("{% autoescape off %}{{ a|linenumbers }} {{ "
+                        "b|linenumbers }}{% endautoescape %}")
       << dict << "1. one\n2. <two>\n3. three 1. one\n2. &lt;two&gt;\n3. three"
       << NoError;
 
@@ -485,9 +502,12 @@
   dict.insert(QStringLiteral("b"), QVariant::fromValue(markSafe(
                                        QStringLiteral("Apple &amp; banana"))));
 
-  QTest::newRow("filter-lower01")
-      << QStringLiteral("{% autoescape off %}{{ a|lower }} {{ b|lower }}{% endautoescape %}")
-      << dict << QStringLiteral("apple & banana apple &amp; banana") << NoError;
+  QTest::newRow("filter-lower01") << QStringLiteral(
+      "{% autoescape off %}{{ a|lower }} {{ b|lower }}{% endautoescape %}")
+                                  << dict
+                                  << QStringLiteral(
+                                         "apple & banana apple &amp; banana")
+                                  << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("a"), QStringLiteral("Apple & banana"));
@@ -504,17 +524,17 @@
   dict.clear();
   dict.insert(QStringLiteral("a"), markSafe(QStringLiteral("&")));
 
-  QTest::newRow("filter-make_list01")
-      << QStringLiteral(
-             "{% autoescape off %}{{ a|make_list }}{% endautoescape %}")
-      << dict << "[u\'&\']" << NoError;
+  QTest::newRow("filter-make_list01") << QStringLiteral(
+      "{% autoescape off %}{{ a|make_list }}{% endautoescape %}")
+                                      << dict << "[u\'&\']" << NoError;
   QTest::newRow("filter-make_list02")
       << QStringLiteral("{{ a|make_list }}") << dict
       << QStringLiteral("[u&#39;&amp;&#39;]") << NoError;
 
-  QTest::newRow("filter-make_list03")
-      << QStringLiteral("{% autoescape off %}{{ a|make_list|stringformat:\"%1\"|safe }}{% endautoescape %}")
-      << dict << QStringLiteral("[u\'&\']") << NoError;
+  QTest::newRow("filter-make_list03") << QStringLiteral(
+      "{% autoescape off %}{{ a|make_list|stringformat:\"%1\"|safe }}{% "
+      "endautoescape %}") << dict << QStringLiteral("[u\'&\']")
+                                      << NoError;
   QTest::newRow("filter-make_list04")
       << QStringLiteral("{{ a|make_list|stringformat:\"%1\"|safe }}") << dict
       << QStringLiteral("[u\'&\']") << NoError;
@@ -526,9 +546,10 @@
   dict.insert(QStringLiteral("a"), QStringLiteral("a & b"));
   dict.insert(QStringLiteral("b"), markSafe(QStringLiteral("a &amp; b")));
 
-  QTest::newRow("filter-slugify01")
-      << QStringLiteral("{% autoescape off %}{{ a|slugify }} {{ b|slugify }}{% endautoescape %}")
-      << dict << QStringLiteral("a-b a-amp-b") << NoError;
+  QTest::newRow("filter-slugify01") << QStringLiteral(
+      "{% autoescape off %}{{ a|slugify }} {{ b|slugify }}{% endautoescape %}")
+                                    << dict << QStringLiteral("a-b a-amp-b")
+                                    << NoError;
   QTest::newRow("filter-slugify02")
       << QStringLiteral("{{ a|slugify }} {{ b|slugify }}") << dict
       << QStringLiteral("a-b a-amp-b") << NoError;
@@ -551,8 +572,9 @@
   QTest::newRow("escapejs02")
       << QStringLiteral(
              "{% autoescape off %}{{ a|escapejs }}{% endautoescape %}")
-      << dict << "testing\\u000D\\u000Ajavascript \\u0027string\\u0022 "
-                 "\\u003Cb\\u003Eescaping\\u003C/b\\u003E"
+      << dict
+      << "testing\\u000D\\u000Ajavascript \\u0027string\\u0022 "
+         "\\u003Cb\\u003Eescaping\\u003C/b\\u003E"
       << NoError;
 
   //  Notice that escaping is applied *after* any filters, so the string
@@ -584,15 +606,15 @@
 
   dict.clear();
   dict.insert(QStringLiteral("a"), QStringLiteral("JOE\'S CRAB SHACK"));
-  QTest::newRow("filter-title01") << "{{ a|title }}" << dict
-                                  << QStringLiteral("Joe&#39;s Crab Shack")
-                                  << NoError;
+  QTest::newRow("filter-title01")
+      << "{{ a|title }}" << dict << QStringLiteral("Joe&#39;s Crab Shack")
+      << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("a"), QStringLiteral("555 WEST 53RD STREET"));
-  QTest::newRow("filter-title02") << "{{ a|title }}" << dict
-                                  << QStringLiteral("555 West 53rd Street")
-                                  << NoError;
+  QTest::newRow("filter-title02")
+      << "{{ a|title }}" << dict << QStringLiteral("555 West 53rd Street")
+      << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("a"), QStringLiteral("alpha & bravo"));
@@ -616,9 +638,10 @@
   dict.insert(QStringLiteral("b"),
               QVariant::fromValue(markSafe(QStringLiteral("a &amp; b"))));
 
-  QTest::newRow("filter-upper01")
-      << QStringLiteral("{% autoescape off %}{{ a|upper }} {{ b|upper }}{% endautoescape %}")
-      << dict << QStringLiteral("A & B A &AMP; B") << NoError;
+  QTest::newRow("filter-upper01") << QStringLiteral(
+      "{% autoescape off %}{{ a|upper }} {{ b|upper }}{% endautoescape %}")
+                                  << dict << QStringLiteral("A & B A &AMP; B")
+                                  << NoError;
   QTest::newRow("filter-upper02")
       << QStringLiteral("{{ a|upper }} {{ b|upper }}") << dict
       << QStringLiteral("A &amp; B A &amp;AMP; B") << NoError;
@@ -726,7 +749,8 @@
               QVariant::fromValue(markSafe(QStringLiteral("a &amp; b"))));
 
   QTest::newRow("filter-wordcount01")
-      << QStringLiteral("{% autoescape off %}{{ a|wordcount }} {{ b|wordcount }}{% endautoescape %}")
+      << QStringLiteral("{% autoescape off %}{{ a|wordcount }} {{ b|wordcount "
+                        "}}{% endautoescape %}")
       << dict << QStringLiteral("3 3") << NoError;
 
   QTest::newRow("filter-wordcount02")
@@ -739,7 +763,8 @@
               QVariant::fromValue(markSafe(QStringLiteral("a & b"))));
 
   QTest::newRow("filter-wordwrap01")
-      << QStringLiteral("{% autoescape off %}{{ a|wordwrap:3 }} {{ b|wordwrap:3 }}{% endautoescape %}")
+      << QStringLiteral("{% autoescape off %}{{ a|wordwrap:3 }} {{ "
+                        "b|wordwrap:3 }}{% endautoescape %}")
       << dict << "a &\nb a &\nb" << NoError;
 
   QTest::newRow("filter-wordwrap02")
@@ -747,6 +772,13 @@
       << "a &amp;\nb a &\nb" << NoError;
 
   dict.clear();
+  QTest::newRow("filter-wordwrap03")
+      << QStringLiteral("{{xx|wordwrap}}") << dict << "" << NoError;
+
+  QTest::newRow("filter-wordwrap04")
+      << QStringLiteral("{{|wordwrap}}") << dict << "" << NoError;
+
+  dict.clear();
   dict.insert(QStringLiteral("a"), QStringLiteral("a&b"));
   dict.insert(QStringLiteral("b"),
               QVariant::fromValue(markSafe(QStringLiteral("a&b"))));
@@ -784,29 +816,29 @@
   dict.insert(QStringLiteral("b"),
               QVariant::fromValue(markSafe(QStringLiteral("x&amp;y"))));
 
-  QTest::newRow("filter-cut01") << "{% autoescape off %}{{ a|cut:\"x\" }} {{ "
-                                   "b|cut:\"x\" }}{% endautoescape %}"
-                                << dict << QStringLiteral("&y &amp;y")
-                                << NoError;
+  QTest::newRow("filter-cut01")
+      << "{% autoescape off %}{{ a|cut:\"x\" }} {{ "
+         "b|cut:\"x\" }}{% endautoescape %}"
+      << dict << QStringLiteral("&y &amp;y") << NoError;
   QTest::newRow("filter-cut02") << "{{ a|cut:\"x\" }} {{ b|cut:\"x\" }}" << dict
                                 << QStringLiteral("&amp;y &amp;y") << NoError;
-  QTest::newRow("filter-cut03") << "{% autoescape off %}{{ a|cut:\"&\" }} {{ "
-                                   "b|cut:\"&\" }}{% endautoescape %}"
-                                << dict << QStringLiteral("xy xamp;y")
-                                << NoError;
+  QTest::newRow("filter-cut03")
+      << "{% autoescape off %}{{ a|cut:\"&\" }} {{ "
+         "b|cut:\"&\" }}{% endautoescape %}"
+      << dict << QStringLiteral("xy xamp;y") << NoError;
   QTest::newRow("filter-cut04") << "{{ a|cut:\"&\" }} {{ b|cut:\"&\" }}" << dict
                                 << QStringLiteral("xy xamp;y") << NoError;
 
   //  Passing ";" to cut can break existing HTML entities, so those strings
   //  are auto-escaped.
 
-  QTest::newRow("filter-cut05") << "{% autoescape off %}{{ a|cut:\";\" }} {{ "
-                                   "b|cut:\";\" }}{% endautoescape %}"
-                                << dict << QStringLiteral("x&y x&ampy")
-                                << NoError;
-  QTest::newRow("filter-cut06") << "{{ a|cut:\";\" }} {{ b|cut:\";\" }}" << dict
-                                << QStringLiteral("x&amp;y x&amp;ampy")
-                                << NoError;
+  QTest::newRow("filter-cut05")
+      << "{% autoescape off %}{{ a|cut:\";\" }} {{ "
+         "b|cut:\";\" }}{% endautoescape %}"
+      << dict << QStringLiteral("x&y x&ampy") << NoError;
+  QTest::newRow("filter-cut06")
+      << "{{ a|cut:\";\" }} {{ b|cut:\";\" }}" << dict
+      << QStringLiteral("x&amp;y x&amp;ampy") << NoError;
 
   //  The "escape" filter works the same whether autoescape is on or off,
   //  but it has no effect on strings already marked as safe.
@@ -819,9 +851,10 @@
   QTest::newRow("filter-escape01")
       << QStringLiteral("{{ a|escape }} {{ b|escape }}") << dict
       << QStringLiteral("x&amp;y x&y") << NoError;
-  QTest::newRow("filter-escape02")
-      << QStringLiteral("{% autoescape off %}{{ a|escape }} {{ b|escape }}{% endautoescape %}")
-      << dict << QStringLiteral("x&amp;y x&y") << NoError;
+  QTest::newRow("filter-escape02") << QStringLiteral(
+      "{% autoescape off %}{{ a|escape }} {{ b|escape }}{% endautoescape %}")
+                                   << dict << QStringLiteral("x&amp;y x&y")
+                                   << NoError;
 
   //  It is only applied once, regardless of the number of times it
   //  appears in a chain.
@@ -833,9 +866,9 @@
       << QStringLiteral(
              "{% autoescape off %}{{ a|escape|escape }}{% endautoescape %}")
       << dict << QStringLiteral("x&amp;y") << NoError;
-  QTest::newRow("filter-escape04") << QStringLiteral("{{ a|escape|escape }}")
-                                   << dict << QStringLiteral("x&amp;y")
-                                   << NoError;
+  QTest::newRow("filter-escape04")
+      << QStringLiteral("{{ a|escape|escape }}") << dict
+      << QStringLiteral("x&amp;y") << NoError;
 
   //  Force_escape is applied immediately. It can be used to provide
   //  double-escaping, for example.
@@ -848,7 +881,8 @@
       << QStringLiteral("{{ a|force_escape }}") << dict
       << QStringLiteral("x&amp;y") << NoError;
   QTest::newRow("filter-force-escape03")
-      << QStringLiteral("{% autoescape off %}{{ a|force_escape|force_escape }}{% endautoescape %}")
+      << QStringLiteral("{% autoescape off %}{{ a|force_escape|force_escape "
+                        "}}{% endautoescape %}")
       << dict << QStringLiteral("x&amp;amp;y") << NoError;
   QTest::newRow("filter-force-escape04")
       << QStringLiteral("{{ a|force_escape|force_escape }}") << dict
@@ -857,15 +891,17 @@
   //  Because the result of force_escape is "safe", an additional
   //  escape filter has no effect.
 
-  QTest::newRow("filter-force-escape05")
-      << QStringLiteral("{% autoescape off %}{{ a|force_escape|escape }}{% endautoescape %}")
-      << dict << QStringLiteral("x&amp;y") << NoError;
+  QTest::newRow("filter-force-escape05") << QStringLiteral(
+      "{% autoescape off %}{{ a|force_escape|escape }}{% endautoescape %}")
+                                         << dict << QStringLiteral("x&amp;y")
+                                         << NoError;
   QTest::newRow("filter-force-escape06")
       << QStringLiteral("{{ a|force_escape|escape }}") << dict
       << QStringLiteral("x&amp;y") << NoError;
-  QTest::newRow("filter-force-escape07")
-      << QStringLiteral("{% autoescape off %}{{ a|escape|force_escape }}{% endautoescape %}")
-      << dict << QStringLiteral("x&amp;y") << NoError;
+  QTest::newRow("filter-force-escape07") << QStringLiteral(
+      "{% autoescape off %}{{ a|escape|force_escape }}{% endautoescape %}")
+                                         << dict << QStringLiteral("x&amp;y")
+                                         << NoError;
   QTest::newRow("filter-force-escape08")
       << QStringLiteral("{{ a|escape|force_escape }}") << dict
       << QStringLiteral("x&amp;y") << NoError;
@@ -881,13 +917,15 @@
       << QStringLiteral("{{ a|linebreaks }} {{ b|linebreaks }}") << dict
       << QStringLiteral("<p>x&amp;<br />y</p> <p>x&<br />y</p>") << NoError;
   QTest::newRow("filter-linebreaks02")
-      << QStringLiteral("{% autoescape off %}{{ a|linebreaks }} {{ b|linebreaks }}{% endautoescape %}")
+      << QStringLiteral("{% autoescape off %}{{ a|linebreaks }} {{ "
+                        "b|linebreaks }}{% endautoescape %}")
       << dict << QStringLiteral("<p>x&<br />y</p> <p>x&<br />y</p>") << NoError;
   QTest::newRow("filter-linebreaksbr01")
       << QStringLiteral("{{ a|linebreaksbr }} {{ b|linebreaksbr }}") << dict
       << QStringLiteral("x&amp;<br />y x&<br />y") << NoError;
   QTest::newRow("filter-linebreaksbr02")
-      << QStringLiteral("{% autoescape off %}{{ a|linebreaksbr }} {{ b|linebreaksbr }}{% endautoescape %}")
+      << QStringLiteral("{% autoescape off %}{{ a|linebreaksbr }} {{ "
+                        "b|linebreaksbr }}{% endautoescape %}")
       << dict << QStringLiteral("x&<br />y x&<br />y") << NoError;
 
   dict.clear();
@@ -902,17 +940,17 @@
       << dict << QStringLiteral("<b>hello</b> -- <b>hello</b>") << NoError;
 
   dict.clear();
-  dict.insert(QStringLiteral("a"), QVariantList() << QStringLiteral("&")
-                                                  << QStringLiteral("<"));
+  dict.insert(QStringLiteral("a"),
+              QVariantList() << QStringLiteral("&") << QStringLiteral("<"));
 
   QTest::newRow("filter-safeseq01")
       << "{{ a|join:\", \" }} -- {{ a|safeseq|join:\", \" }}" << dict
       << QStringLiteral("&amp;, &lt; -- &, <") << NoError;
-  QTest::newRow("filter-safeseq02") << "{% autoescape off %}{{ a|join:\", \" "
-                                       "}} -- {{ a|safeseq|join:\", \" "
-                                       "}}{% endautoescape %}"
-                                    << dict << QStringLiteral("&, < -- &, <")
-                                    << NoError;
+  QTest::newRow("filter-safeseq02")
+      << "{% autoescape off %}{{ a|join:\", \" "
+         "}} -- {{ a|safeseq|join:\", \" "
+         "}}{% endautoescape %}"
+      << dict << QStringLiteral("&, < -- &, <") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("a"), QStringLiteral("<a>x</a> <p><b>y</b></p>"));
@@ -930,7 +968,8 @@
       << QStringLiteral("{{ a|striptags }} {{ b|striptags }}") << dict
       << QStringLiteral("x y x y") << NoError;
   QTest::newRow("filter-striptags02")
-      << QStringLiteral("{% autoescape off %}{{ a|striptags }} {{ b|striptags }}{% endautoescape %}")
+      << QStringLiteral("{% autoescape off %}{{ a|striptags }} {{ b|striptags "
+                        "}}{% endautoescape %}")
       << dict << QStringLiteral("x y x y") << NoError;
 }
 
@@ -943,39 +982,38 @@
 
   Dict dict;
 
-  dict.insert(QStringLiteral("a"), QVariantList() << QStringLiteral("a&b")
+  dict.insert(QStringLiteral("a"),
+              QVariantList() << QStringLiteral("a&b") << QStringLiteral("x"));
+  dict.insert(QStringLiteral("b"), QVariantList() << QVariant::fromValue(
+                                       markSafe(QStringLiteral("a&b")))
                                                   << QStringLiteral("x"));
-  dict.insert(QStringLiteral("b"),
-              QVariantList()
-                  << QVariant::fromValue(markSafe(QStringLiteral("a&b")))
-                  << QStringLiteral("x"));
 
   QTest::newRow("filter-first01")
       << QStringLiteral("{{ a|first }} {{ b|first }}") << dict
       << QStringLiteral("a&amp;b a&b") << NoError;
-  QTest::newRow("filter-first02")
-      << QStringLiteral("{% autoescape off %}{{ a|first }} {{ b|first }}{% endautoescape %}")
-      << dict << QStringLiteral("a&b a&b") << NoError;
+  QTest::newRow("filter-first02") << QStringLiteral(
+      "{% autoescape off %}{{ a|first }} {{ b|first }}{% endautoescape %}")
+                                  << dict << QStringLiteral("a&b a&b")
+                                  << NoError;
 
   dict.clear();
-  dict.insert(QStringLiteral("a"), QVariantList() << QStringLiteral("x")
-                                                  << QStringLiteral("a&b"));
+  dict.insert(QStringLiteral("a"),
+              QVariantList() << QStringLiteral("x") << QStringLiteral("a&b"));
   dict.insert(QStringLiteral("b"),
-              QVariantList()
-                  << QStringLiteral("x")
-                  << QVariant::fromValue(markSafe(QStringLiteral("a&b"))));
+              QVariantList() << QStringLiteral(
+                  "x") << QVariant::fromValue(markSafe(QStringLiteral("a&b"))));
 
-  QTest::newRow("filter-last01") << QStringLiteral("{{ a|last }} {{ b|last }}")
-                                 << dict << QStringLiteral("a&amp;b a&b")
-                                 << NoError;
+  QTest::newRow("filter-last01")
+      << QStringLiteral("{{ a|last }} {{ b|last }}") << dict
+      << QStringLiteral("a&amp;b a&b") << NoError;
   QTest::newRow("filter-last02")
       << QStringLiteral(
              "{% autoescape off %}{{ a|last }} {{ b|last }}{% endautoescape %}")
       << dict << QStringLiteral("a&b a&b") << NoError;
 
   dict.clear();
-  dict.insert(QStringLiteral("a"), QVariantList() << QStringLiteral("a&b")
-                                                  << QStringLiteral("a&b"));
+  dict.insert(QStringLiteral("a"),
+              QVariantList() << QStringLiteral("a&b") << QStringLiteral("a&b"));
   dict.insert(QStringLiteral("b"),
               QVariantList()
                   << QVariant::fromValue(markSafe(QStringLiteral("a&b")))
@@ -983,9 +1021,17 @@
   QTest::newRow("filter-random01")
       << QStringLiteral("{{ a|random }} {{ b|random }}") << dict
       << QStringLiteral("a&amp;b a&b") << NoError;
-  QTest::newRow("filter-random02")
-      << QStringLiteral("{% autoescape off %}{{ a|random }} {{ b|random }}{% endautoescape %}")
-      << dict << QStringLiteral("a&b a&b") << NoError;
+  QTest::newRow("filter-random02") << QStringLiteral(
+      "{% autoescape off %}{{ a|random }} {{ b|random }}{% endautoescape %}")
+                                   << dict << QStringLiteral("a&b a&b")
+                                   << NoError;
+
+  dict.clear();
+  dict.insert(QStringLiteral("empty_list"), QVariantList());
+  QTest::newRow("filter-random03") << QStringLiteral("{{empty_list|random}}")
+                                   << dict << QStringLiteral("") << NoError;
+  QTest::newRow("filter-random04")
+      << QStringLiteral("{{|random}}") << dict << QStringLiteral("") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("a"), QStringLiteral("a&b"));
@@ -1001,10 +1047,16 @@
       << dict << QStringLiteral("&b &b") << NoError;
 
   dict.clear();
+  QTest::newRow("filter-slice03")
+      << "{{xx|slice}}" << dict << QStringLiteral("") << NoError;
+  QTest::newRow("filter-slice04")
+      << "{{|slice}}" << dict << QStringLiteral("") << NoError;
+
+  dict.clear();
   QVariantList sublist;
   sublist << QVariant(QStringLiteral("<y"));
-  dict.insert(QStringLiteral("a"), QVariantList() << QStringLiteral("x>")
-                                                  << QVariant(sublist));
+  dict.insert(QStringLiteral("a"),
+              QVariantList() << QStringLiteral("x>") << QVariant(sublist));
 
   QTest::newRow("filter-unordered_list01")
       << QStringLiteral("{{ a|unordered_list }}") << dict
@@ -1018,8 +1070,8 @@
   dict.clear();
   sublist.clear();
   sublist << markSafe(QStringLiteral("<y"));
-  dict.insert(QStringLiteral("a"), QVariantList() << QStringLiteral("x>")
-                                                  << QVariant(sublist));
+  dict.insert(QStringLiteral("a"),
+              QVariantList() << QStringLiteral("x>") << QVariant(sublist));
 
   QTest::newRow("filter-unordered_list03")
       << QStringLiteral("{{ a|unordered_list }}") << dict
@@ -1033,8 +1085,8 @@
   dict.clear();
   sublist.clear();
   sublist << QVariant(QStringLiteral("<y"));
-  dict.insert(QStringLiteral("a"), QVariantList() << QStringLiteral("x>")
-                                                  << QVariant(sublist));
+  dict.insert(QStringLiteral("a"),
+              QVariantList() << QStringLiteral("x>") << QVariant(sublist));
 
   QTest::newRow("filter-unordered_list05")
       << QStringLiteral(
@@ -1044,9 +1096,9 @@
 
   //  length filter.
   dict.clear();
-  dict.insert(QStringLiteral("list"), QVariantList() << QStringLiteral("4")
-                                                     << QVariant() << true
-                                                     << QVariantHash());
+  dict.insert(QStringLiteral("list"), QVariantList()
+                                          << QStringLiteral("4") << QVariant()
+                                          << true << QVariantHash());
 
   QTest::newRow("length01") << QStringLiteral("{{ list|length }}") << dict
                             << QStringLiteral("4") << NoError;
@@ -1074,14 +1126,14 @@
   dict.clear();
   dict.insert(QStringLiteral("int"), 7);
 
-  QTest::newRow("length05") << QStringLiteral("{{ int|length }}") << dict
-                            << QString() << NoError;
+  QTest::newRow("length05")
+      << QStringLiteral("{{ int|length }}") << dict << QString() << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("None"), QVariant());
 
-  QTest::newRow("length06") << QStringLiteral("{{ None|length }}") << dict
-                            << QString() << NoError;
+  QTest::newRow("length06")
+      << QStringLiteral("{{ None|length }}") << dict << QString() << NoError;
 
   //  length_is filter.
 
@@ -1127,47 +1179,45 @@
   dict.clear();
   dict.insert(QStringLiteral("var"), QStringLiteral("django"));
 
-  QTest::newRow("length_is06")
-      << QStringLiteral(
-             "{% with var|length as my_length %}{{ my_length }}{% endwith %}")
-      << dict << QStringLiteral("6") << NoError;
+  QTest::newRow("length_is06") << QStringLiteral(
+      "{% with var|length as my_length %}{{ my_length }}{% endwith %}")
+                               << dict << QStringLiteral("6") << NoError;
 
   //  Boolean return value from length_is should not be coerced to a string
 
   dict.clear();
-  QTest::newRow("length_is07") << "{% if \"X\"|length_is:0 %}Length is 0{% "
-                                  "else %}Length not 0{% endif %}"
-                               << dict << QStringLiteral("Length not 0")
-                               << NoError;
-  QTest::newRow("length_is08") << "{% if \"X\"|length_is:1 %}Length is 1{% "
-                                  "else %}Length not 1{% endif %}"
-                               << dict << QStringLiteral("Length is 1")
-                               << NoError;
+  QTest::newRow("length_is07")
+      << "{% if \"X\"|length_is:0 %}Length is 0{% "
+         "else %}Length not 0{% endif %}"
+      << dict << QStringLiteral("Length not 0") << NoError;
+  QTest::newRow("length_is08")
+      << "{% if \"X\"|length_is:1 %}Length is 1{% "
+         "else %}Length not 1{% endif %}"
+      << dict << QStringLiteral("Length is 1") << NoError;
 
   //  Invalid uses that should fail silently.
 
   dict.clear();
   dict.insert(QStringLiteral("var"), QStringLiteral("django"));
 
-  QTest::newRow("length_is09") << "{{ var|length_is:\"fish\" }}" << dict
-                               << QString() << NoError;
+  QTest::newRow("length_is09")
+      << "{{ var|length_is:\"fish\" }}" << dict << QString() << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("int"), 7);
 
-  QTest::newRow("length_is10") << "{{ int|length_is:\"1\" }}" << dict
-                               << QString() << NoError;
+  QTest::newRow("length_is10")
+      << "{{ int|length_is:\"1\" }}" << dict << QString() << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("none"), QVariant());
 
-  QTest::newRow("length_is11") << "{{ none|length_is:\"1\" }}" << dict
-                               << QString() << NoError;
+  QTest::newRow("length_is11")
+      << "{{ none|length_is:\"1\" }}" << dict << QString() << NoError;
 
   dict.clear();
-  dict.insert(QStringLiteral("a"), QVariantList()
-                                       << QStringLiteral("alpha")
-                                       << QStringLiteral("beta & me"));
+  dict.insert(QStringLiteral("a"), QVariantList() << QStringLiteral(
+                                       "alpha") << QStringLiteral("beta & me"));
 
   QTest::newRow("join01") << "{{ a|join:\", \" }}" << dict
                           << QStringLiteral("alpha, beta &amp; me") << NoError;
@@ -1190,17 +1240,15 @@
   dict.insert(QStringLiteral("var"), Grantlee::markSafe(QStringLiteral(" & ")));
   QTest::newRow("join06") << "{{ a|join:var }}" << dict
                           << QStringLiteral("alpha & beta &amp; me") << NoError;
-  dict.insert(QStringLiteral("a"), QVariantList()
-                                       << QStringLiteral("Alpha")
-                                       << QStringLiteral("Beta & Me"));
+  dict.insert(QStringLiteral("a"), QVariantList() << QStringLiteral(
+                                       "Alpha") << QStringLiteral("Beta & Me"));
   dict.insert(QStringLiteral("var"), QStringLiteral(" & "));
   QTest::newRow("join07") << "{{ a|join:var|lower }}" << dict
                           << QStringLiteral("alpha &amp; beta &amp; me")
                           << NoError;
 
-  dict.insert(QStringLiteral("a"), QVariantList()
-                                       << QStringLiteral("Alpha")
-                                       << QStringLiteral("Beta & Me"));
+  dict.insert(QStringLiteral("a"), QVariantList() << QStringLiteral(
+                                       "Alpha") << QStringLiteral("Beta & Me"));
   dict.insert(QStringLiteral("var"), Grantlee::markSafe(QStringLiteral(" & ")));
   QTest::newRow("join08") << "{{ a|join:var|lower }}" << dict
                           << QStringLiteral("alpha & beta &amp; me") << NoError;
@@ -1289,8 +1337,8 @@
                       << QStringLiteral("French") << QStringLiteral("Irish");
 
   for (auto i = 0; i < cities.size(); ++i) {
-    listList << QVariant(QVariantList() << cities.at(i) << countries.at(i)
-                                        << languages.at(i));
+    listList << QVariant(QVariantList()
+                         << cities.at(i) << countries.at(i) << languages.at(i));
   }
 
   dict.insert(QStringLiteral("listList"), listList);
@@ -1299,16 +1347,18 @@
       << "{% with listList|dictsort:'0' as result %}{% for item in result "
          "%}{{ "
          "item.0 }};{{ item.1 }};{{ item.2 }},{% endfor %}{% endwith %}"
-      << dict << "Berlin;Germany;German,Dublin;Ireland;Irish,London;England;"
-                 "English,Paris;France;French,"
+      << dict
+      << "Berlin;Germany;German,Dublin;Ireland;Irish,London;England;"
+         "English,Paris;France;French,"
       << NoError;
 
   QTest::newRow("dictsort04")
       << "{% with listList|dictsort:'1' as result %}{% for item in result "
          "%}{{ "
          "item.0 }};{{ item.1 }};{{ item.2 }},{% endfor %}{% endwith %}"
-      << dict << "London;England;English,Paris;France;French,Berlin;Germany;"
-                 "German,Dublin;Ireland;Irish,"
+      << dict
+      << "London;England;English,Paris;France;French,Berlin;Germany;"
+         "German,Dublin;Ireland;Irish,"
       << NoError;
 }
 
@@ -1329,8 +1379,8 @@
 
   dict.insert(QStringLiteral("a"), QStringLiteral(""));
 
-  QTest::newRow("filter-default01") << "{{ a|default:\"x<\" }}" << dict
-                                    << QStringLiteral("x<") << NoError;
+  QTest::newRow("filter-default01")
+      << "{{ a|default:\"x<\" }}" << dict << QStringLiteral("x<") << NoError;
   QTest::newRow("filter-default02")
       << "{% autoescape off %}{{ a|default:\"x<\" }}{% endautoescape %}" << dict
       << QStringLiteral("x<") << NoError;
@@ -1339,8 +1389,8 @@
   dict.insert(QStringLiteral("a"),
               QVariant::fromValue(markSafe(QStringLiteral("x>"))));
 
-  QTest::newRow("filter-default03") << "{{ a|default:\"x<\" }}" << dict
-                                    << QStringLiteral("x>") << NoError;
+  QTest::newRow("filter-default03")
+      << "{{ a|default:\"x<\" }}" << dict << QStringLiteral("x>") << NoError;
   QTest::newRow("filter-default04")
       << "{% autoescape off %}{{ a|default:\"x<\" }}{% endautoescape %}" << dict
       << QStringLiteral("x>") << NoError;
@@ -1348,8 +1398,8 @@
   dict.clear();
   dict.insert(QStringLiteral("a"), QVariant());
 
-  QTest::newRow("filter-default_if_none01") << "{{ a|default:\"x<\" }}" << dict
-                                            << QStringLiteral("x<") << NoError;
+  QTest::newRow("filter-default_if_none01")
+      << "{{ a|default:\"x<\" }}" << dict << QStringLiteral("x<") << NoError;
   QTest::newRow("filter-default_if_none02")
       << "{% autoescape off %}{{ a|default:\"x<\" }}{% endautoescape %}" << dict
       << QStringLiteral("x<") << NoError;
@@ -1409,10 +1459,9 @@
 
   QTest::newRow("chaining05") << QStringLiteral("{{ a|escape|capfirst }}")
                               << dict << QStringLiteral("A &lt; b") << NoError;
-  QTest::newRow("chaining06")
-      << QStringLiteral(
-             "{% autoescape off %}{{ a|escape|capfirst }}{% endautoescape %}")
-      << dict << QStringLiteral("A &lt; b") << NoError;
+  QTest::newRow("chaining06") << QStringLiteral(
+      "{% autoescape off %}{{ a|escape|capfirst }}{% endautoescape %}")
+                              << dict << QStringLiteral("A &lt; b") << NoError;
 
   //  Force to safe, then back (also showing why using force_escape too
   //  early in a chain can lead to unexpected results).
@@ -1429,17 +1478,16 @@
       << "{% autoescape off %}{{ a|cut:\";\"|force_escape }}{% endautoescape "
          "%}"
       << dict << QStringLiteral("a &lt; b") << NoError;
-  QTest::newRow("chaining11") << "{{ a|cut:\"b\"|safe }}" << dict
-                              << QStringLiteral("a < ") << NoError;
+  QTest::newRow("chaining11")
+      << "{{ a|cut:\"b\"|safe }}" << dict << QStringLiteral("a < ") << NoError;
   QTest::newRow("chaining12")
       << "{% autoescape off %}{{ a|cut:\"b\"|safe }}{% endautoescape %}" << dict
       << QStringLiteral("a < ") << NoError;
   QTest::newRow("chaining13") << QStringLiteral("{{ a|safe|force_escape }}")
                               << dict << QStringLiteral("a &lt; b") << NoError;
-  QTest::newRow("chaining14")
-      << QStringLiteral(
-             "{% autoescape off %}{{ a|safe|force_escape }}{% endautoescape %}")
-      << dict << QStringLiteral("a &lt; b") << NoError;
+  QTest::newRow("chaining14") << QStringLiteral(
+      "{% autoescape off %}{{ a|safe|force_escape }}{% endautoescape %}")
+                              << dict << QStringLiteral("a &lt; b") << NoError;
 
   //   //  Filters decorated with stringfilter still respect is_safe.
   //
@@ -1512,9 +1560,9 @@
                                      << dict << QStringLiteral("2") << NoError;
   QTest::newRow("filter-getdigit03") << QStringLiteral("{{ 123|get_digit:3 }}")
                                      << dict << QStringLiteral("1") << NoError;
-  QTest::newRow("filter-getdigit04") << QStringLiteral("{{ 123|get_digit:4 }}")
-                                     << dict << QStringLiteral("123")
-                                     << NoError;
+  QTest::newRow("filter-getdigit04")
+      << QStringLiteral("{{ 123|get_digit:4 }}") << dict
+      << QStringLiteral("123") << NoError;
 }
 
 QTEST_MAIN(TestFilters)
diff -Naur grantlee-5.1.0/templates/tests/testgenericcontainers.cpp grantlee/templates/tests/testgenericcontainers.cpp
--- grantlee-5.1.0/templates/tests/testgenericcontainers.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/tests/testgenericcontainers.cpp	2019-07-09 09:53:47.149090758 -0500
@@ -151,32 +151,41 @@
 
 template <typename T> QString getTemplate()
 {
-  return QStringLiteral("{{ container.size }};{{ container.count }};{% for item in container %}{{ item }},{% endfor %}");
+  return QStringLiteral("{{ container.size }};{{ container.count }};{% for "
+                        "item in container %}{{ item }},{% endfor %}");
 }
 
 template <> QString getTemplate<QDateTime>()
 {
-  return QStringLiteral("{{ container.size }};{{ container.count }};{% for item in container %}{{ item|date }},{% endfor %}");
+  return QStringLiteral("{{ container.size }};{{ container.count }};{% for "
+                        "item in container %}{{ item|date }},{% endfor %}");
 }
 
 template <> QString getTemplate<QObject *>()
 {
-  return QStringLiteral("{{ container.size }};{{ container.count }};{% for item in container %}{{ item.objectName }},{% endfor %}");
+  return QStringLiteral(
+      "{{ container.size }};{{ container.count }};{% for item in container "
+      "%}{{ item.objectName }},{% endfor %}");
 }
 
 template <typename T> QString getAssociativeTemplate()
 {
-  return QStringLiteral("{{ container.size }};{{ container.count }};{% for item in container.values %}{{ item }},{% endfor %}");
+  return QStringLiteral("{{ container.size }};{{ container.count }};{% for "
+                        "item in container.values %}{{ item }},{% endfor %}");
 }
 
 template <> QString getAssociativeTemplate<QDateTime>()
 {
-  return QStringLiteral("{{ container.size }};{{ container.count }};{% for item in container.values %}{{ item|date }},{% endfor %}");
+  return QStringLiteral(
+      "{{ container.size }};{{ container.count }};{% for item in "
+      "container.values %}{{ item|date }},{% endfor %}");
 }
 
 template <> QString getAssociativeTemplate<QObject *>()
 {
-  return QStringLiteral("{{ container.size }};{{ container.count }};{% for item in container.values %}{{ item.objectName }},{% endfor %}");
+  return QStringLiteral(
+      "{{ container.size }};{{ container.count }};{% for item in "
+      "container.values %}{{ item.objectName }},{% endfor %}");
 }
 
 template <typename T> QStringList getResults()
diff -Naur grantlee-5.1.0/templates/tests/testgenerictypes.cpp grantlee/templates/tests/testgenerictypes.cpp
--- grantlee-5.1.0/templates/tests/testgenerictypes.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/tests/testgenerictypes.cpp	2019-07-09 09:53:47.149090758 -0500
@@ -301,7 +301,8 @@
 
   {
     Grantlee::Template t1 = engine.newTemplate(
-        QStringLiteral("{% for person in people.values %}({{ person.name }}:{{ person.age }}),{% endfor %}"),
+        QStringLiteral("{% for person in people.values %}({{ person.name }}:{{ "
+                       "person.age }}),{% endfor %}"),
         QStringLiteral("people_template"));
 
     auto result = t1->render(&c);
@@ -325,7 +326,8 @@
 
   {
     Grantlee::Template t1 = engine.newTemplate(
-        QStringLiteral("{% for item in people.items %}({{ item.1.name }}:{{ item.1.age }}),{% endfor %}"),
+        QStringLiteral("{% for item in people.items %}({{ item.1.name }}:{{ "
+                       "item.1.age }}),{% endfor %}"),
         QStringLiteral("people_template"));
     auto result = t1->render(&c);
     if (!unordered)
@@ -636,7 +638,9 @@
 
   auto result = t1->render(&c);
 
-  auto expectedResult = QStringLiteral("(M (0 : (L (V 1,2,),(V 3,4,),),(1 : (L (V 5,6,),(V 7,8,),),),(M (0 : (L (V 9,10,),(V 11,12,),),(1 : (L (V 13,14,),(V 15,16,),),),");
+  auto expectedResult = QStringLiteral(
+      "(M (0 : (L (V 1,2,),(V 3,4,),),(1 : (L (V 5,6,),(V 7,8,),),),(M (0 : (L "
+      "(V 9,10,),(V 11,12,),),(1 : (L (V 13,14,),(V 15,16,),),),");
 
   QCOMPARE(result, expectedResult);
 }
diff -Naur grantlee-5.1.0/templates/tests/testinternationalization.cpp grantlee/templates/tests/testinternationalization.cpp
--- grantlee-5.1.0/templates/tests/testinternationalization.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/tests/testinternationalization.cpp	2019-07-09 09:53:47.149090758 -0500
@@ -181,39 +181,39 @@
   // Translations here are not meant to be accurate, but are meant
   // only to test for example that disambiguation and arg reordering works.
 
-  QTest::newRow("string-01") << "Birthday"
-                             << "Birthday"
-                             << "Geburtstag"
-                             << "Anniversaire" << QString() << QString()
-                             << QVariantList();
-
-  QTest::newRow("string-02") << "%n People"
-                             << "1 People"
-                             << "1 Person"
-                             << "1 Personne" << QString()
-                             << QStringLiteral("%n People")
-                             << (QVariantList() << 1);
-
-  QTest::newRow("string-03") << "%n People"
-                             << "2 People"
-                             << "2 Personen"
-                             << "2 Personnes" << QString()
-                             << QStringLiteral("%n People")
-                             << (QVariantList() << 2);
-
-  QTest::newRow("string-04") << "Name"
-                             << "Name"
-                             << "Name eines Buches"
-                             << "Nom d'un livre"
-                             << QStringLiteral("Name of a Book") << QString()
-                             << QVariantList();
-
-  QTest::newRow("string-05") << "Name"
-                             << "Name"
-                             << "Namen einer Person"
-                             << "Nom d'une personne"
-                             << QStringLiteral("Name of a Person") << QString()
-                             << QVariantList();
+  QTest::newRow("string-01")
+      << "Birthday"
+      << "Birthday"
+      << "Geburtstag"
+      << "Anniversaire" << QString() << QString() << QVariantList();
+
+  QTest::newRow("string-02")
+      << "%n People"
+      << "1 People"
+      << "1 Person"
+      << "1 Personne" << QString() << QStringLiteral("%n People")
+      << (QVariantList() << 1);
+
+  QTest::newRow("string-03")
+      << "%n People"
+      << "2 People"
+      << "2 Personen"
+      << "2 Personnes" << QString() << QStringLiteral("%n People")
+      << (QVariantList() << 2);
+
+  QTest::newRow("string-04")
+      << "Name"
+      << "Name"
+      << "Name eines Buches"
+      << "Nom d'un livre" << QStringLiteral("Name of a Book") << QString()
+      << QVariantList();
+
+  QTest::newRow("string-05")
+      << "Name"
+      << "Name"
+      << "Namen einer Person"
+      << "Nom d'une personne" << QStringLiteral("Name of a Person") << QString()
+      << QVariantList();
 
   QTest::newRow("string-06")
       << "%n People"
@@ -294,7 +294,8 @@
       << "%1 messages at %2, fraction of total: %3. Rating : %4"
       << "1000 messages at 2005-05-07, fraction of total: 0.6. Rating : 4.8"
       << "1000 Nachrichten am 2005-05-07, ratio: 0.6. Bemessungen : 4.8"
-      << QStringLiteral("1000 messages au 2005-05-07, la fraction du total: 0.6. Note: 4.8")
+      << QStringLiteral("1000 messages au 2005-05-07, la fraction du total: "
+                        "0.6. Note: 4.8")
       << QString() << QString()
       << (QVariantList() << 1000 << QDate(2005, 5, 7) << 0.6 << 4.8);
 
@@ -346,14 +347,18 @@
   Dict dict;
   dict.insert(QStringLiteral("date"), QDate(2005, 5, 7));
   QTest::newRow("fragment-01")
-      << QStringLiteral("{% i18n '%1 messages at %2, fraction of total: %3. Rating : %4' _(1000) _(date) _(0.6) _(4.8) %}")
-      << QStringLiteral("1000 messages at 7 May 2005, fraction of total: 0.60. Rating : 4.80")
+      << QStringLiteral("{% i18n '%1 messages at %2, fraction of total: %3. "
+                        "Rating : %4' _(1000) _(date) _(0.6) _(4.8) %}")
+      << QStringLiteral("1000 messages at 7 May 2005, fraction of total: 0.60. "
+                        "Rating : 4.80")
       << QStringLiteral(
              "1,000 messages at 5/7/05, fraction of total: 0.60. Rating : 4.80")
-      << QStringLiteral("1,000 messages at 07/05/2005, fraction of total: 0.60. Rating : 4.80")
+      << QStringLiteral("1,000 messages at 07/05/2005, fraction of total: "
+                        "0.60. Rating : 4.80")
       << QStringLiteral(
              "1.000 Nachrichten am 07.05.05, ratio: 0,60. Bemessungen : 4,80")
-      << QStringLiteral("1\u00A0000 messages au 07/05/2005, la fraction du total: 0,60. Note: 4,80")
+      << QStringLiteral("1\u00A0000 messages au 07/05/2005, la fraction du "
+                        "total: 0,60. Note: 4,80")
       << dict;
 
   dict.insert(QStringLiteral("integer"), 1000);
@@ -361,14 +366,19 @@
   dict.insert(QStringLiteral("largeFloat"), 4.8);
 
   QTest::newRow("fragment-02")
-      << QStringLiteral("{% i18n '%1 messages at %2, fraction of total: %3. Rating : %4' _(integer) _(date) _(smallFloat) _(largeFloat) %}")
-      << QStringLiteral("1000 messages at 7 May 2005, fraction of total: 0.60. Rating : 4.80")
+      << QStringLiteral(
+             "{% i18n '%1 messages at %2, fraction of total: %3. Rating : %4' "
+             "_(integer) _(date) _(smallFloat) _(largeFloat) %}")
+      << QStringLiteral("1000 messages at 7 May 2005, fraction of total: 0.60. "
+                        "Rating : 4.80")
       << QStringLiteral(
              "1,000 messages at 5/7/05, fraction of total: 0.60. Rating : 4.80")
-      << QStringLiteral("1,000 messages at 07/05/2005, fraction of total: 0.60. Rating : 4.80")
+      << QStringLiteral("1,000 messages at 07/05/2005, fraction of total: "
+                        "0.60. Rating : 4.80")
       << QStringLiteral(
              "1.000 Nachrichten am 07.05.05, ratio: 0,60. Bemessungen : 4,80")
-      << QStringLiteral("1\u00A0000 messages au 07/05/2005, la fraction du total: 0,60. Note: 4,80")
+      << QStringLiteral("1\u00A0000 messages au 07/05/2005, la fraction du "
+                        "total: 0,60. Note: 4,80")
       << dict;
 
   dict.insert(QStringLiteral("time"), QTime(4, 5, 6));
@@ -376,15 +386,19 @@
               QDateTime(QDate(2005, 5, 7), QTime(4, 5, 6)));
 
   QTest::newRow("fragment-03")
-      << QStringLiteral("{{ _(integer) }} -- {{ _(date) }} -- {{ _(smallFloat) }} -- {{ _(largeFloat) }} -- {{ _(time) }} -- {{ _(dateTime) }}")
-      << QStringLiteral("1000 -- 7 May 2005 -- 0.60 -- 4.80 -- 04:05:06 -- 7 May 2005 04:05:06")
+      << QStringLiteral(
+             "{{ _(integer) }} -- {{ _(date) }} -- {{ _(smallFloat) }} -- {{ "
+             "_(largeFloat) }} -- {{ _(time) }} -- {{ _(dateTime) }}")
+      << QStringLiteral("1000 -- 7 May 2005 -- 0.60 -- 4.80 -- 04:05:06 -- 7 "
+                        "May 2005 04:05:06")
       << QStringLiteral(
              "1,000 -- 5/7/05 -- 0.60 -- 4.80 -- 4:05 AM -- 5/7/05 4:05 AM")
       << QStringLiteral(
              "1,000 -- 07/05/2005 -- 0.60 -- 4.80 -- 04:05 -- 07/05/2005 04:05")
       << QStringLiteral(
              "1.000 -- 07.05.05 -- 0,60 -- 4,80 -- 04:05 -- 07.05.05 04:05")
-      << QStringLiteral("1\u00A0000 -- 07/05/2005 -- 0,60 -- 4,80 -- 04:05 -- 07/05/2005 04:05")
+      << QStringLiteral("1\u00A0000 -- 07/05/2005 -- 0,60 -- 4,80 -- 04:05 -- "
+                        "07/05/2005 04:05")
       << dict;
 
 #ifndef Q_CC_MSVC
@@ -574,10 +588,10 @@
       << QStringLiteral("1,000 0.60 4.80") << QStringLiteral("1.000 0,60 4,80")
       << QStringLiteral("1\u00A0000 0,60 4,80") << dict;
 
-  QTest::newRow("fragment-08") << QStringLiteral("{{ 'this'|cut:_(\"i\") }}")
-                               << QStringLiteral("ths") << QStringLiteral("ths")
-                               << QStringLiteral("ths") << QStringLiteral("ths")
-                               << QStringLiteral("ths") << dict;
+  QTest::newRow("fragment-08")
+      << QStringLiteral("{{ 'this'|cut:_(\"i\") }}") << QStringLiteral("ths")
+      << QStringLiteral("ths") << QStringLiteral("ths") << QStringLiteral("ths")
+      << QStringLiteral("ths") << dict;
 }
 
 void TestInternationalization::testSafeContent()
@@ -610,28 +624,33 @@
                            << QStringLiteral("Aujourd&#39;hui est 07/05/2005")
                            << dict;
 
-  QTest::newRow("safe-02") << QStringLiteral("{% autoescape off %}{% i18n 'Today is %1' _(date) %}{% endautoescape %}")
+  QTest::newRow("safe-02") << QStringLiteral(
+      "{% autoescape off %}{% i18n 'Today is %1' _(date) %}{% endautoescape %}")
                            << QStringLiteral("Today is 7 May 2005")
                            << QStringLiteral("Aujourd'hui est 07/05/2005")
                            << dict;
 
-  QTest::newRow("safe-03") << QStringLiteral("{% i18n_var 'Today is %1' _(date) as today_greeting %}-{{ today_greeting }}-")
-                           << QStringLiteral("-Today is 7 May 2005-")
+  QTest::newRow("safe-03") << QStringLiteral(
+      "{% i18n_var 'Today is %1' _(date) as today_greeting %}-{{ "
+      "today_greeting }}-") << QStringLiteral("-Today is 7 May 2005-")
                            << QStringLiteral("-Aujourd&#39;hui est 07/05/2005-")
                            << dict;
 
-  QTest::newRow("safe-04") << QStringLiteral("{% autoescape off %}{% i18n_var 'Today is %1' _(date) as today_greeting %}-{{ today_greeting }}-{% endautoescape %}")
+  QTest::newRow("safe-04") << QStringLiteral(
+      "{% autoescape off %}{% i18n_var 'Today is %1' _(date) as today_greeting "
+      "%}-{{ today_greeting }}-{% endautoescape %}")
                            << QStringLiteral("-Today is 7 May 2005-")
                            << QStringLiteral("-Aujourd'hui est 07/05/2005-")
                            << dict;
 
-  QTest::newRow("safe-05")
-      << QStringLiteral(
-             "{% with 'Today' as rawText %}-{{ _(rawText) }}-{% endwith %}")
-      << QStringLiteral("-Today-") << QStringLiteral("-Aujourd&#39;hui-")
-      << dict;
+  QTest::newRow("safe-05") << QStringLiteral(
+      "{% with 'Today' as rawText %}-{{ _(rawText) }}-{% endwith %}")
+                           << QStringLiteral("-Today-")
+                           << QStringLiteral("-Aujourd&#39;hui-") << dict;
 
-  QTest::newRow("safe-06") << QStringLiteral("{% autoescape off %}{% with 'Today' as rawText %}-{{ _(rawText) }}-{% endwith %}{% endautoescape %}")
+  QTest::newRow("safe-06") << QStringLiteral(
+      "{% autoescape off %}{% with 'Today' as rawText %}-{{ _(rawText) }}-{% "
+      "endwith %}{% endautoescape %}")
                            << QStringLiteral("-Today-")
                            << QStringLiteral("-Aujourd'hui-") << dict;
 
@@ -641,10 +660,10 @@
                            << QStringLiteral("-Today-")
                            << QStringLiteral("-Aujourd&#39;hui-") << dict;
 
-  QTest::newRow("safe-08")
-      << QStringLiteral(
-             "{% autoescape off %}-{{ _(today_text) }}-{% endautoescape %}")
-      << QStringLiteral("-Today-") << QStringLiteral("-Aujourd'hui-") << dict;
+  QTest::newRow("safe-08") << QStringLiteral(
+      "{% autoescape off %}-{{ _(today_text) }}-{% endautoescape %}")
+                           << QStringLiteral("-Today-")
+                           << QStringLiteral("-Aujourd'hui-") << dict;
 
   dict.insert(QStringLiteral("today_and_tomorrow_text"),
               markSafe(QStringLiteral("Today &amp; tomorrow")));
@@ -654,25 +673,30 @@
       << QStringLiteral("-Today &amp;amp; tomorrow-")
       << QStringLiteral("-Aujourd&#39;hui &amp;amp; demain-") << dict;
 
-  QTest::newRow("safe-10") << QStringLiteral("{% autoescape off %}-{{ _(today_and_tomorrow_text) }}-{% endautoescape %}")
-                           << QStringLiteral("-Today &amp; tomorrow-")
+  QTest::newRow("safe-10") << QStringLiteral(
+      "{% autoescape off %}-{{ _(today_and_tomorrow_text) }}-{% endautoescape "
+      "%}") << QStringLiteral("-Today &amp; tomorrow-")
                            << QStringLiteral("-Aujourd'hui &amp; demain-")
                            << dict;
 
   QTest::newRow("safe-11") << QStringLiteral(
-                                  "{% i18nc 'The current day is' 'Today is' %}")
+      "{% i18nc 'The current day is' 'Today is' %}")
                            << QStringLiteral("Today is")
                            << QStringLiteral("Aujourd&#39;hui est") << dict;
 
-  QTest::newRow("safe-12") << QStringLiteral("{% autoescape off %}{% i18nc 'The current day is' 'Today is' %}{% endautoescape %}")
-                           << QStringLiteral("Today is")
+  QTest::newRow("safe-12") << QStringLiteral(
+      "{% autoescape off %}{% i18nc 'The current day is' 'Today is' %}{% "
+      "endautoescape %}") << QStringLiteral("Today is")
                            << QStringLiteral("Aujourd'hui est") << dict;
 
-  QTest::newRow("safe-13") << QStringLiteral("{% i18nc_var 'The current day is' 'Today is' as today_greeting %}-{{ today_greeting }}-")
-                           << QStringLiteral("-Today is-")
+  QTest::newRow("safe-13") << QStringLiteral(
+      "{% i18nc_var 'The current day is' 'Today is' as today_greeting %}-{{ "
+      "today_greeting }}-") << QStringLiteral("-Today is-")
                            << QStringLiteral("-Aujourd&#39;hui est-") << dict;
 
-  QTest::newRow("safe-14") << QStringLiteral("{% autoescape off %}{% i18nc_var 'The current day is' 'Today is' as today_greeting %}-{{ today_greeting }}-{% endautoescape %}")
+  QTest::newRow("safe-14") << QStringLiteral(
+      "{% autoescape off %}{% i18nc_var 'The current day is' 'Today is' as "
+      "today_greeting %}-{{ today_greeting }}-{% endautoescape %}")
                            << QStringLiteral("-Today is-")
                            << QStringLiteral("-Aujourd'hui est-") << dict;
 
@@ -686,78 +710,106 @@
                            << QStringLiteral("2 personnes aujourd&#39;hui")
                            << dict;
 
-  QTest::newRow("safe-17")
-      << QStringLiteral("{% autoescape off %}{% i18np '%n people today' 1 %}{% endautoescape %}")
-      << QStringLiteral("1 people today") // Not really testing English here.
-      << QStringLiteral("1 personne aujourd'hui") << dict;
+  QTest::newRow("safe-17") << QStringLiteral(
+      "{% autoescape off %}{% i18np '%n people today' 1 %}{% endautoescape %}")
+                           << QStringLiteral(
+                                  "1 people today") // Not really testing
+                                                    // English here.
+                           << QStringLiteral("1 personne aujourd'hui") << dict;
 
-  QTest::newRow("safe-18") << QStringLiteral("{% autoescape off %}{% i18np '%n people today' 2 %}{% endautoescape %}")
+  QTest::newRow("safe-18") << QStringLiteral(
+      "{% autoescape off %}{% i18np '%n people today' 2 %}{% endautoescape %}")
                            << QStringLiteral("2 people today")
                            << QStringLiteral("2 personnes aujourd'hui") << dict;
 
-  QTest::newRow("safe-19")
-      << QStringLiteral("{% i18np_var '%n people today' 1 as num_people %}-{{ num_people }}-")
-      << QStringLiteral("-1 people today-") // Not really testing English here.
-      << QStringLiteral("-1 personne aujourd&#39;hui-") << dict;
+  QTest::newRow("safe-19") << QStringLiteral(
+      "{% i18np_var '%n people today' 1 as num_people %}-{{ num_people }}-")
+                           << QStringLiteral(
+                                  "-1 people today-") // Not really testing
+                                                      // English here.
+                           << QStringLiteral("-1 personne aujourd&#39;hui-")
+                           << dict;
 
-  QTest::newRow("safe-20") << QStringLiteral("{% i18np_var '%n people today' 2 as num_people %}-{{ num_people }}-")
+  QTest::newRow("safe-20") << QStringLiteral(
+      "{% i18np_var '%n people today' 2 as num_people %}-{{ num_people }}-")
                            << QStringLiteral("-2 people today-")
                            << QStringLiteral("-2 personnes aujourd&#39;hui-")
                            << dict;
 
   QTest::newRow("safe-21")
-      << QStringLiteral("{% autoescape off %}{% i18np_var '%n people today' 1 as num_people %}-{{ num_people }}-{% endautoescape %}")
+      << QStringLiteral("{% autoescape off %}{% i18np_var '%n people today' 1 "
+                        "as num_people %}-{{ num_people }}-{% endautoescape %}")
       << QStringLiteral("-1 people today-") // Not really testing English here.
       << QStringLiteral("-1 personne aujourd'hui-") << dict;
 
-  QTest::newRow("safe-22") << QStringLiteral("{% autoescape off %}{% i18np_var '%n people today' 2 as num_people %}-{{ num_people }}-{% endautoescape %}")
+  QTest::newRow("safe-22") << QStringLiteral(
+      "{% autoescape off %}{% i18np_var '%n people today' 2 as num_people "
+      "%}-{{ num_people }}-{% endautoescape %}")
                            << QStringLiteral("-2 people today-")
                            << QStringLiteral("-2 personnes aujourd'hui-")
                            << dict;
 
   QTest::newRow("safe-23")
-      << QStringLiteral("{% i18ncp 'The number of people who have visited today' '%n people visited today' 1 %}")
+      << QStringLiteral("{% i18ncp 'The number of people who have visited "
+                        "today' '%n people visited today' 1 %}")
       << QStringLiteral(
              "1 people visited today") // Not really testing English here.
       << QStringLiteral("1 personne a visité aujourd&#39;hui") << dict;
 
   QTest::newRow("safe-24")
-      << QStringLiteral("{% i18ncp 'The number of people who have visited today' '%n people visited today' 2 %}")
+      << QStringLiteral("{% i18ncp 'The number of people who have visited "
+                        "today' '%n people visited today' 2 %}")
       << QStringLiteral("2 people visited today")
       << QStringLiteral("2 personnes a visité aujourd&#39;hui") << dict;
 
   QTest::newRow("safe-25")
-      << QStringLiteral("{% autoescape off %}{% i18ncp 'The number of people who have visited today' '%n people visited today' 1 %}{% endautoescape %}")
+      << QStringLiteral(
+             "{% autoescape off %}{% i18ncp 'The number of people who have "
+             "visited today' '%n people visited today' 1 %}{% endautoescape %}")
       << QStringLiteral(
              "1 people visited today") // Not really testing English here.
       << QStringLiteral("1 personne a visité aujourd'hui") << dict;
 
-  QTest::newRow("safe-26") << QStringLiteral("{% autoescape off %}{% i18ncp 'The number of people who have visited today' '%n people visited today' 2 %}{% endautoescape %}")
+  QTest::newRow("safe-26") << QStringLiteral(
+      "{% autoescape off %}{% i18ncp 'The number of people who have visited "
+      "today' '%n people visited today' 2 %}{% endautoescape %}")
                            << QStringLiteral("2 people visited today")
                            << QStringLiteral("2 personnes a visité aujourd'hui")
                            << dict;
 
   QTest::newRow("safe-27")
-      << QStringLiteral("{% i18ncp_var 'The number of people who have visited today' '%n people visited today' 1 as num_people %}-{{ num_people }}-")
+      << QStringLiteral(
+             "{% i18ncp_var 'The number of people who have visited today' '%n "
+             "people visited today' 1 as num_people %}-{{ num_people }}-")
       << QStringLiteral(
              "-1 people visited today-") // Not really testing English here.
       << QStringLiteral("-1 personne a visité aujourd&#39;hui-") << dict;
 
-  QTest::newRow("safe-28")
-      << QStringLiteral("{% i18ncp_var 'The number of people who have visited today' '%n people visited today' 2 as num_people %}-{{ num_people }}-")
-      << QStringLiteral("-2 people visited today-")
-      << QStringLiteral("-2 personnes a visité aujourd&#39;hui-") << dict;
+  QTest::newRow("safe-28") << QStringLiteral(
+      "{% i18ncp_var 'The number of people who have visited today' '%n people "
+      "visited today' 2 as num_people %}-{{ num_people }}-")
+                           << QStringLiteral("-2 people visited today-")
+                           << QStringLiteral(
+                                  "-2 personnes a visité aujourd&#39;hui-")
+                           << dict;
 
   QTest::newRow("safe-29")
-      << QStringLiteral("{% autoescape off %}{% i18ncp_var 'The number of people who have visited today' '%n people visited today' 1 as num_people %}-{{ num_people }}-{% endautoescape %}")
+      << QStringLiteral(
+             "{% autoescape off %}{% i18ncp_var 'The number of people who have "
+             "visited today' '%n people visited today' 1 as num_people %}-{{ "
+             "num_people }}-{% endautoescape %}")
       << QStringLiteral(
              "-1 people visited today-") // Not really testing English here.
       << QStringLiteral("-1 personne a visité aujourd'hui-") << dict;
 
-  QTest::newRow("safe-30")
-      << QStringLiteral("{% autoescape off %}{% i18ncp_var 'The number of people who have visited today' '%n people visited today' 2 as num_people %}-{{ num_people }}-{% endautoescape %}")
-      << QStringLiteral("-2 people visited today-")
-      << QStringLiteral("-2 personnes a visité aujourd'hui-") << dict;
+  QTest::newRow("safe-30") << QStringLiteral(
+      "{% autoescape off %}{% i18ncp_var 'The number of people who have "
+      "visited today' '%n people visited today' 2 as num_people %}-{{ "
+      "num_people }}-{% endautoescape %}")
+                           << QStringLiteral("-2 people visited today-")
+                           << QStringLiteral(
+                                  "-2 personnes a visité aujourd'hui-")
+                           << dict;
 }
 
 void TestInternationalization::testFailure()
@@ -774,10 +826,14 @@
 
   QTest::newRow("fail-01") << QStringLiteral(
       "{% i18np_var '%n people visited today' as num_people %}");
-  QTest::newRow("fail-02") << QStringLiteral("{% i18ncp_var 'The number of people who have visited today' '%n people visited today' as num_people %}");
+  QTest::newRow("fail-02") << QStringLiteral(
+      "{% i18ncp_var 'The number of people who have visited today' '%n people "
+      "visited today' as num_people %}");
   QTest::newRow("fail-03") << QStringLiteral(
       "{% i18np '%n people visited today' %}");
-  QTest::newRow("fail-04") << QStringLiteral("{% i18ncp 'The number of people who have visited today' '%n people visited today' %}");
+  QTest::newRow("fail-04") << QStringLiteral(
+      "{% i18ncp 'The number of people who have visited today' '%n people "
+      "visited today' %}");
 }
 
 void TestInternationalization::testDates()
@@ -848,9 +904,9 @@
   QTest::addColumn<QString>("deInteger");
   QTest::addColumn<QString>("frInteger");
 
-  QTest::newRow("integer-01") << 7 << QStringLiteral("7") << QStringLiteral("7")
-                              << QStringLiteral("7") << QStringLiteral("7")
-                              << QStringLiteral("7") << QStringLiteral("7");
+  QTest::newRow("integer-01")
+      << 7 << QStringLiteral("7") << QStringLiteral("7") << QStringLiteral("7")
+      << QStringLiteral("7") << QStringLiteral("7") << QStringLiteral("7");
 
   QTest::newRow("integer-02")
       << 7000 << QStringLiteral("7000") << QStringLiteral("7000")
@@ -886,10 +942,10 @@
   QTest::addColumn<QString>("deFloatingPoint");
   QTest::addColumn<QString>("frFloatingPoint");
 
-  QTest::newRow("float-01") << qreal(7.4) << QStringLiteral("7.4")
-                            << QStringLiteral("7.40") << QStringLiteral("7.40")
-                            << QStringLiteral("7.40") << QStringLiteral("7,40")
-                            << QStringLiteral("7,40");
+  QTest::newRow("float-01")
+      << qreal(7.4) << QStringLiteral("7.4") << QStringLiteral("7.40")
+      << QStringLiteral("7.40") << QStringLiteral("7.40")
+      << QStringLiteral("7,40") << QStringLiteral("7,40");
 }
 
 void TestInternationalization::testTimes()
@@ -983,12 +1039,12 @@
       << QStringLiteral("6/7/05 3:12 PM") << QStringLiteral("07/06/2005 15:12")
       << QStringLiteral("07.06.05 15:12") << QStringLiteral("07/06/2005 15:12");
 
-  QTest::newRow("datetime-04") << QDateTime(QDate(2005, 10, 11), QTime(5, 6, 7))
-                               << QStringLiteral("11 Oct 2005 05:06:07")
-                               << QStringLiteral("10/11/05 5:06 AM")
-                               << QStringLiteral("11/10/2005 05:06")
-                               << QStringLiteral("11.10.05 05:06")
-                               << QStringLiteral("11/10/2005 05:06");
+  QTest::newRow("datetime-04")
+      << QDateTime(QDate(2005, 10, 11), QTime(5, 6, 7))
+      << QStringLiteral("11 Oct 2005 05:06:07")
+      << QStringLiteral("10/11/05 5:06 AM")
+      << QStringLiteral("11/10/2005 05:06") << QStringLiteral("11.10.05 05:06")
+      << QStringLiteral("11/10/2005 05:06");
 
   QTest::newRow("datetime-05")
       << QDateTime(QDate(2005, 10, 11), QTime(11, 12, 13))
diff -Naur grantlee-5.1.0/templates/tests/testloadertags.cpp grantlee/templates/tests/testloadertags.cpp
--- grantlee-5.1.0/templates/tests/testloadertags.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/tests/testloadertags.cpp	2019-07-09 09:53:47.149090758 -0500
@@ -76,8 +76,8 @@
   m_engine->setPluginPaths(QStringList()
                            << QStringLiteral(GRANTLEE_PLUGIN_PATH)
                            << QStringLiteral(":/plugins/") // For testtags.qs
-                           );
-#ifdef HAVE_QTSCRIPT_LIB
+  );
+#ifdef HAVE_QTQML_LIB
   m_engine->addDefaultLibrary(QStringLiteral("grantlee_scriptabletags"));
 #endif
 }
@@ -156,13 +156,13 @@
   QTest::newRow("include 05")
       << incl05 << dict << QStringLiteral("template with a space") << NoError;
 
-  QTest::newRow("include06") << "{% include \"include 05\" %}" << dict
-                             << QStringLiteral("template with a space")
-                             << NoError;
+  QTest::newRow("include06")
+      << "{% include \"include 05\" %}" << dict
+      << QStringLiteral("template with a space") << NoError;
 
   dict.clear();
-  dict.insert(QStringLiteral("list"), QVariantList() << QVariant()
-                                                     << QVariant());
+  dict.insert(QStringLiteral("list"), QVariantList()
+                                          << QVariant() << QVariant());
   QTest::newRow("include07")
       << "{% for i in list %}{% include \"include 05\" %}{% endfor %}" << dict
       << QStringLiteral("template with a spacetemplate with a space")
@@ -179,17 +179,21 @@
   Dict dict;
   // Basic test
   QTest::newRow("namedendblocks01")
-      << QStringLiteral("1{% block first %}_{% block second %}2{% endblock second %}_{% endblock first %}3")
+      << QStringLiteral("1{% block first %}_{% block second %}2{% endblock "
+                        "second %}_{% endblock first %}3")
       << dict << QStringLiteral("1_2_3") << NoError;
   // Unbalanced blocks
   QTest::newRow("namedendblocks02")
-      << QStringLiteral("1{% block first %}_{% block second %}2{% endblock first %}_{% endblock second %}3")
+      << QStringLiteral("1{% block first %}_{% block second %}2{% endblock "
+                        "first %}_{% endblock second %}3")
       << dict << QString() << InvalidBlockTagError;
   QTest::newRow("namedendblocks03")
-      << QStringLiteral("1{% block first %}_{% block second %}2{% endblock %}_{% endblock second %}3")
+      << QStringLiteral("1{% block first %}_{% block second %}2{% endblock "
+                        "%}_{% endblock second %}3")
       << dict << QString() << InvalidBlockTagError;
   QTest::newRow("namedendblocks04")
-      << QStringLiteral("1{% block first %}_{% block second %}2{% endblock second %}_{% endblock third %}3")
+      << QStringLiteral("1{% block first %}_{% block second %}2{% endblock "
+                        "second %}_{% endblock third %}3")
       << dict << QString() << InvalidBlockTagError;
   QTest::newRow("namedendblocks05")
       << QStringLiteral(
@@ -197,10 +201,12 @@
       << dict << QString() << InvalidBlockTagError;
   // Mixed named and unnamed endblocks
   QTest::newRow("namedendblocks06")
-      << QStringLiteral("1{% block first %}_{% block second %}2{% endblock %}_{% endblock first %}3")
+      << QStringLiteral("1{% block first %}_{% block second %}2{% endblock "
+                        "%}_{% endblock first %}3")
       << dict << QStringLiteral("1_2_3") << NoError;
   QTest::newRow("namedendblocks07")
-      << QStringLiteral("1{% block first %}_{% block second %}2{% endblock second %}_{% endblock %}3")
+      << QStringLiteral("1{% block first %}_{% block second %}2{% endblock "
+                        "second %}_{% endblock %}3")
       << dict << QStringLiteral("1_2_3") << NoError;
 
   //## INHERITANCE ###########################################################
@@ -210,16 +216,17 @@
       "1{% block first %}&{% endblock %}3{% block second %}_{% endblock %}");
   loader->setTemplate(QStringLiteral("inheritance01"), inh1);
 
-  QTest::newRow("inheritance01") << inh1 << dict << QStringLiteral("1&3_")
-                                 << NoError;
+  QTest::newRow("inheritance01")
+      << inh1 << dict << QStringLiteral("1&3_") << NoError;
 
   auto inh2
-      = QStringLiteral("{% extends \"inheritance01\" %}{% block first %}2{% endblock %}{% block second %}4{% endblock %}");
+      = QStringLiteral("{% extends \"inheritance01\" %}{% block first %}2{% "
+                       "endblock %}{% block second %}4{% endblock %}");
   loader->setTemplate(QStringLiteral("inheritance02"), inh2);
 
   // Standard two-level inheritance
-  QTest::newRow("inheritance02") << inh2 << dict << QStringLiteral("1234")
-                                 << NoError;
+  QTest::newRow("inheritance02")
+      << inh2 << dict << QStringLiteral("1234") << NoError;
   // Three-level with no redefinitions on third level
   QTest::newRow("inheritance03")
       << QStringLiteral("{% extends 'inheritance02' %}") << dict
@@ -229,8 +236,8 @@
   auto inh4 = QStringLiteral("{% extends \"inheritance01\" %}");
   loader->setTemplate(QStringLiteral("inheritance04"), inh4);
 
-  QTest::newRow("inheritance04") << inh4 << dict << QStringLiteral("1&3_")
-                                 << NoError;
+  QTest::newRow("inheritance04")
+      << inh4 << dict << QStringLiteral("1&3_") << NoError;
   // Two-level with double quotes instead of single quotes
   QTest::newRow("inheritance05") << "{% extends \"inheritance02\" %}" << dict
                                  << QStringLiteral("1234") << NoError;
@@ -246,14 +253,13 @@
 
   dict.clear();
   // Two-level with one block defined, one block not defined
-  QTest::newRow("inheritance07") << inh7 << dict << QStringLiteral("1&35")
-                                 << NoError;
+  QTest::newRow("inheritance07")
+      << inh7 << dict << QStringLiteral("1&35") << NoError;
   // Three-level with one block defined on this level, two blocks defined next
   // level
-  QTest::newRow("inheritance08")
-      << QStringLiteral(
-             "{% extends 'inheritance02' %}{% block second %}5{% endblock %}")
-      << dict << QStringLiteral("1235") << NoError;
+  QTest::newRow("inheritance08") << QStringLiteral(
+      "{% extends 'inheritance02' %}{% block second %}5{% endblock %}")
+                                 << dict << QStringLiteral("1235") << NoError;
 
   // Three-level with second and third levels blank
   QTest::newRow("inheritance09")
@@ -269,30 +275,33 @@
   // Three-level with both blocks defined on this level, but none on second
   // level
   QTest::newRow("inheritance11")
-      << QStringLiteral("{% extends 'inheritance04' %}{% block first %}2{% endblock %}{% block second %}4{% endblock %}")
+      << QStringLiteral("{% extends 'inheritance04' %}{% block first %}2{% "
+                        "endblock %}{% block second %}4{% endblock %}")
       << dict << QStringLiteral("1234") << NoError;
   // Three-level with this level providing one and second level providing the
   // other
-  QTest::newRow("inheritance12")
-      << QStringLiteral(
-             "{% extends 'inheritance07' %}{% block first %}2{% endblock %}")
-      << dict << QStringLiteral("1235") << NoError;
+  QTest::newRow("inheritance12") << QStringLiteral(
+      "{% extends 'inheritance07' %}{% block first %}2{% endblock %}")
+                                 << dict << QStringLiteral("1235") << NoError;
   // Three-level with this level overriding second level
   QTest::newRow("inheritance13")
-      << QStringLiteral("{% extends 'inheritance02' %}{% block first %}a{% endblock %}{% block second %}b{% endblock %}")
+      << QStringLiteral("{% extends 'inheritance02' %}{% block first %}a{% "
+                        "endblock %}{% block second %}b{% endblock %}")
       << dict << QStringLiteral("1a3b") << NoError;
   // A block defined only in a child template shouldn't be displayed
   QTest::newRow("inheritance14")
-      << QStringLiteral("{% extends 'inheritance01' %}{% block newblock %}NO DISPLAY{% endblock %}")
+      << QStringLiteral("{% extends 'inheritance01' %}{% block newblock %}NO "
+                        "DISPLAY{% endblock %}")
       << dict << QStringLiteral("1&3_") << NoError;
 
   auto inh15
-      = QStringLiteral("{% extends 'inheritance01' %}{% block first %}2{% block inner %}inner{% endblock %}{% endblock %}");
+      = QStringLiteral("{% extends 'inheritance01' %}{% block first %}2{% "
+                       "block inner %}inner{% endblock %}{% endblock %}");
   loader->setTemplate(QStringLiteral("inheritance15"), inh15);
 
   // A block within another block
-  QTest::newRow("inheritance15") << inh15 << dict << QStringLiteral("12inner3_")
-                                 << NoError;
+  QTest::newRow("inheritance15")
+      << inh15 << dict << QStringLiteral("12inner3_") << NoError;
   // A block within another block (level 2)
 
   QTest::newRow("inheritance16")
@@ -300,15 +309,15 @@
              "{% extends 'inheritance15' %}{% block inner %}out{% endblock %}")
       << dict << QStringLiteral("12out3_") << NoError;
 
-#ifdef HAVE_QTSCRIPT_LIB
+#ifdef HAVE_QTQML_LIB
   // {% load %} tag (parent -- setup for exception04)
   auto inh17 = QStringLiteral(
       "{% load testtags %}{% block first %}1234{% endblock %}");
   loader->setTemplate(QStringLiteral("inheritance17"), inh17);
 
   dict.clear();
-  QTest::newRow("inheritance17") << inh17 << dict << QStringLiteral("1234")
-                                 << NoError;
+  QTest::newRow("inheritance17")
+      << inh17 << dict << QStringLiteral("1234") << NoError;
 
   // {% load %} tag (standard usage, without inheritance)
   QTest::newRow("inheritance18")
@@ -317,39 +326,46 @@
 
   // {% load %} tag (within a child template)
   QTest::newRow("inheritance19")
-      << QStringLiteral("{% extends 'inheritance01' %}{% block first %}{% load testtags %}{% echo 400 %}5678{% endblock %}")
+      << QStringLiteral("{% extends 'inheritance01' %}{% block first %}{% load "
+                        "testtags %}{% echo 400 %}5678{% endblock %}")
       << dict << QStringLiteral("140056783_") << NoError;
 #endif
 
-  auto inh20 = QStringLiteral("{% extends 'inheritance01' %}{% block first %}{{ block.super }}a{% endblock %}");
+  auto inh20 = QStringLiteral("{% extends 'inheritance01' %}{% block first "
+                              "%}{{ block.super }}a{% endblock %}");
   loader->setTemplate(QStringLiteral("inheritance20"), inh20);
 
   // Two-level inheritance with {{ block.super }}
-  QTest::newRow("inheritance20") << inh20 << dict << QStringLiteral("1&a3_")
-                                 << NoError;
+  QTest::newRow("inheritance20")
+      << inh20 << dict << QStringLiteral("1&a3_") << NoError;
   // Three-level inheritance with {{ block.super }} from parent
   QTest::newRow("inheritance21")
-      << QStringLiteral("{% extends 'inheritance02' %}{% block first %}{{ block.super }}a{% endblock %}")
+      << QStringLiteral("{% extends 'inheritance02' %}{% block first %}{{ "
+                        "block.super }}a{% endblock %}")
       << dict << QStringLiteral("12a34") << NoError;
   // Three-level inheritance with {{ block.super }} from grandparent
   QTest::newRow("inheritance22")
-      << QStringLiteral("{% extends 'inheritance04' %}{% block first %}{{ block.super }}a{% endblock %}")
+      << QStringLiteral("{% extends 'inheritance04' %}{% block first %}{{ "
+                        "block.super }}a{% endblock %}")
       << dict << QStringLiteral("1&a3_") << NoError;
   // Three-level inheritance with {{ block.super }} from parent and
   // grandparent
   QTest::newRow("inheritance23")
-      << QStringLiteral("{% extends 'inheritance20' %}{% block first %}{{ block.super }}b{% endblock %}")
+      << QStringLiteral("{% extends 'inheritance20' %}{% block first %}{{ "
+                        "block.super }}b{% endblock %}")
       << dict << QStringLiteral("1&ab3_") << NoError;
 
   // Inheritance from local context without use of template loader
 
   auto t = m_engine->newTemplate(
-      QStringLiteral("1{% block first %}_{% endblock %}3{% block second %}_{% endblock %}"),
+      QStringLiteral("1{% block first %}_{% endblock %}3{% block second %}_{% "
+                     "endblock %}"),
       QStringLiteral("context_template"));
   dict.insert(QStringLiteral("context_template"), QVariant::fromValue(t));
 
   QTest::newRow("inheritance24")
-      << QStringLiteral("{% extends context_template %}{% block first %}2{% endblock %}{% block second %}4{% endblock %}")
+      << QStringLiteral("{% extends context_template %}{% block first %}2{% "
+                        "endblock %}{% block second %}4{% endblock %}")
       << dict << QStringLiteral("1234") << NoError;
 
   dict.clear();
@@ -358,7 +374,8 @@
   auto t1 = m_engine->newTemplate(QStringLiteral("Wrong"),
                                   QStringLiteral("context_template_1"));
   auto t2 = m_engine->newTemplate(
-      QStringLiteral("1{% block first %}_{% endblock %}3{% block second %}_{% endblock %}"),
+      QStringLiteral("1{% block first %}_{% endblock %}3{% block second %}_{% "
+                     "endblock %}"),
       QStringLiteral("context_template_2"));
   list << QVariant::fromValue(t1);
   list << QVariant::fromValue(t2);
@@ -367,7 +384,8 @@
 
   // Inheritance from local context with variable parent template
   QTest::newRow("inheritance25")
-      << QStringLiteral("{% extends context_template.1 %}{% block first %}2{% endblock %}{% block second %}4{% endblock %}")
+      << QStringLiteral("{% extends context_template.1 %}{% block first %}2{% "
+                        "endblock %}{% block second %}4{% endblock %}")
       << dict << QStringLiteral("1234") << NoError;
 
   dict.clear();
@@ -384,8 +402,8 @@
   auto inh28 = QStringLiteral("{% block first %}!{% endblock %}");
   loader->setTemplate(QStringLiteral("inheritance 28"), inh28);
 
-  QTest::newRow("inheritance 28") << inh28 << dict << QStringLiteral("!")
-                                  << NoError;
+  QTest::newRow("inheritance 28")
+      << inh28 << dict << QStringLiteral("!") << NoError;
 
   // Inheritance from a template with a space in its name should work.
   QTest::newRow("inheritance29")
@@ -398,70 +416,70 @@
       "1{% if optional %}{% block opt %}2{% endblock %}{% endif %}3");
   loader->setTemplate(QStringLiteral("inheritance30"), inh30);
 
-  QTest::newRow("inheritance30") << inh30 << dict << QStringLiteral("123")
-                                 << NoError;
-  QTest::newRow("inheritance31")
-      << QStringLiteral(
-             "{% extends 'inheritance30' %}{% block opt %}two{% endblock %}")
-      << dict << QStringLiteral("1two3") << NoError;
-  dict.clear();
-  QTest::newRow("inheritance32")
-      << QStringLiteral(
-             "{% extends 'inheritance30' %}{% block opt %}two{% endblock %}")
-      << dict << QStringLiteral("13") << NoError;
+  QTest::newRow("inheritance30")
+      << inh30 << dict << QStringLiteral("123") << NoError;
+  QTest::newRow("inheritance31") << QStringLiteral(
+      "{% extends 'inheritance30' %}{% block opt %}two{% endblock %}")
+                                 << dict << QStringLiteral("1two3") << NoError;
+  dict.clear();
+  QTest::newRow("inheritance32") << QStringLiteral(
+      "{% extends 'inheritance30' %}{% block opt %}two{% endblock %}")
+                                 << dict << QStringLiteral("13") << NoError;
 
   dict.insert(QStringLiteral("optional"), 1);
-  auto inh33 = QStringLiteral("1{% ifequal optional 1 %}{% block opt %}2{% endblock %}{% endifequal %}3");
+  auto inh33 = QStringLiteral("1{% ifequal optional 1 %}{% block opt %}2{% "
+                              "endblock %}{% endifequal %}3");
   loader->setTemplate(QStringLiteral("inheritance33"), inh33);
 
-  QTest::newRow("inheritance33") << inh33 << dict << QStringLiteral("123")
-                                 << NoError;
+  QTest::newRow("inheritance33")
+      << inh33 << dict << QStringLiteral("123") << NoError;
 
-  QTest::newRow("inheritance34")
-      << QStringLiteral(
-             "{% extends 'inheritance33' %}{% block opt %}two{% endblock %}")
-      << dict << QStringLiteral("1two3") << NoError;
-  dict.clear();
-  QTest::newRow("inheritance35")
-      << QStringLiteral(
-             "{% extends 'inheritance33' %}{% block opt %}two{% endblock %}")
-      << dict << QStringLiteral("13") << NoError;
+  QTest::newRow("inheritance34") << QStringLiteral(
+      "{% extends 'inheritance33' %}{% block opt %}two{% endblock %}")
+                                 << dict << QStringLiteral("1two3") << NoError;
+  dict.clear();
+  QTest::newRow("inheritance35") << QStringLiteral(
+      "{% extends 'inheritance33' %}{% block opt %}two{% endblock %}")
+                                 << dict << QStringLiteral("13") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("numbers"), QVariantList() << 1 << 2 << 3);
 
-  auto inh36 = QStringLiteral("{% for n in numbers %}_{% block opt %}{{ n }}{% endblock %}{% endfor %}_");
+  auto inh36 = QStringLiteral("{% for n in numbers %}_{% block opt %}{{ n }}{% "
+                              "endblock %}{% endfor %}_");
   loader->setTemplate(QStringLiteral("inheritance36"), inh36);
 
-  QTest::newRow("inheritance36") << inh36 << dict << QStringLiteral("_1_2_3_")
-                                 << NoError;
+  QTest::newRow("inheritance36")
+      << inh36 << dict << QStringLiteral("_1_2_3_") << NoError;
   QTest::newRow("inheritance37")
       << QStringLiteral(
              "{% extends 'inheritance36' %}{% block opt %}X{% endblock %}")
       << dict << QStringLiteral("_X_X_X_") << NoError;
   dict.clear();
-  QTest::newRow("inheritance38")
-      << QStringLiteral(
-             "{% extends 'inheritance36' %}{% block opt %}X{% endblock %}")
-      << dict << QStringLiteral("_") << NoError;
+  QTest::newRow("inheritance38") << QStringLiteral(
+      "{% extends 'inheritance36' %}{% block opt %}X{% endblock %}")
+                                 << dict << QStringLiteral("_") << NoError;
 
   dict.insert(QStringLiteral("optional"), QStringLiteral("True"));
 
   QTest::newRow("inheritance39")
-      << QStringLiteral("{% extends 'inheritance30' %}{% block opt %}new{{ block.super }}{% endblock %}")
+      << QStringLiteral("{% extends 'inheritance30' %}{% block opt %}new{{ "
+                        "block.super }}{% endblock %}")
       << dict << QStringLiteral("1new23") << NoError;
 
   dict.insert(QStringLiteral("optional"), 1);
 
   QTest::newRow("inheritance40")
-      << QStringLiteral("{% extends 'inheritance33' %}{% block opt %}new{{ block.super }}{% endblock %}")
+      << QStringLiteral("{% extends 'inheritance33' %}{% block opt %}new{{ "
+                        "block.super }}{% endblock %}")
       << dict << QStringLiteral("1new23") << NoError;
 
   dict.clear();
   dict.insert(QStringLiteral("numbers"), QVariantList() << 1 << 2 << 3);
 
   QTest::newRow("inheritance41")
-      << QStringLiteral("{% extends 'inheritance36' %}{% block opt %}new{{ block.super }}{% endblock %}")
+      << QStringLiteral("{% extends 'inheritance36' %}{% block opt %}new{{ "
+                        "block.super }}{% endblock %}")
       << dict << QStringLiteral("_new1_new2_new3_") << NoError;
 
   QTest::newRow("inheritance42")
@@ -477,12 +495,14 @@
                                << dict << QString() << TagSyntaxError;
   // Raise exception for extra {% extends %} tags
   QTest::newRow("exception03")
-      << QStringLiteral("{% extends 'inheritance01' %}{% block first %}2{% endblock %}{% extends 'inheritance16' %}")
+      << QStringLiteral("{% extends 'inheritance01' %}{% block first %}2{% "
+                        "endblock %}{% extends 'inheritance16' %}")
       << dict << QString() << TagSyntaxError;
   // Raise exception for custom tags used in child with {% load %} tag in
   // parent, not in child
   QTest::newRow("exception04")
-      << QStringLiteral("{% extends 'inheritance17' %}{% block first %}{% echo 400 %}5678{% endblock %}")
+      << QStringLiteral("{% extends 'inheritance17' %}{% block first %}{% echo "
+                        "400 %}5678{% endblock %}")
       << dict << QString() << InvalidBlockTagError;
 }
 
@@ -495,10 +515,9 @@
 
   Dict dict;
 
-  QTest::newRow("block-error-01")
-      << QStringLiteral(
-             "{% block repeat %}{% endblock %}{% block repeat %}{% endblock %}")
-      << dict << QString() << TagSyntaxError;
+  QTest::newRow("block-error-01") << QStringLiteral(
+      "{% block repeat %}{% endblock %}{% block repeat %}{% endblock %}")
+                                  << dict << QString() << TagSyntaxError;
   QTest::newRow("block-error-02") << QStringLiteral("{% block %}{% endblock %}")
                                   << dict << QString() << TagSyntaxError;
   QTest::newRow("block-error-03")
diff -Naur grantlee-5.1.0/templates/tests/testscriptabletags.cpp grantlee/templates/tests/testscriptabletags.cpp
--- grantlee-5.1.0/templates/tests/testscriptabletags.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/templates/tests/testscriptabletags.cpp	2019-07-09 09:53:47.149090758 -0500
@@ -70,7 +70,7 @@
   m_engine->setPluginPaths(
       QStringList() << QStringLiteral(GRANTLEE_PLUGIN_PATH)
                     << QStringLiteral(":/plugins/") // For scripteddefaults.qs
-      );
+  );
   m_engine->addDefaultLibrary(QStringLiteral("grantlee_scriptabletags"));
 }
 
@@ -127,11 +127,11 @@
               QVariantList() << QStringLiteral("Tom") << QStringLiteral("Dick")
                              << QStringLiteral("Harry"));
 
-  QTest::newRow("scriptable-tags01") << "{% load scripteddefaults %}{% if2 "
-                                        "\"something\\\" stupid\" %}{{ boo "
-                                        "}}{% endif2 %}"
-                                     << dict << QStringLiteral("Far")
-                                     << NoError;
+  QTest::newRow("scriptable-tags01")
+      << "{% load scripteddefaults %}{% if2 "
+         "\"something\\\" stupid\" %}{{ boo "
+         "}}{% endif2 %}"
+      << dict << QStringLiteral("Far") << NoError;
 
   // Nest c++ tags inside scripted tags.
   QTest::newRow("scriptable-tags02")
@@ -141,12 +141,13 @@
       << dict << QStringLiteral(":Tom;:Dick;:Harry;") << NoError;
 
   // Nest c++ tags inside scripted tags.
-  QTest::newRow("scriptable-tags03")
-      << QStringLiteral("{% load scripteddefaults %}{% if2 boo %}yes{% else %}no{% endif2 %}")
-      << dict << QStringLiteral("yes") << NoError;
-  QTest::newRow("scriptable-tags04")
-      << QStringLiteral("{% load scripteddefaults %}{% if2 foo %}yes{% else %}no{% endif2 %}")
-      << dict << QStringLiteral("no") << NoError;
+  QTest::newRow("scriptable-tags03") << QStringLiteral(
+      "{% load scripteddefaults %}{% if2 boo %}yes{% else %}no{% endif2 %}")
+                                     << dict << QStringLiteral("yes")
+                                     << NoError;
+  QTest::newRow("scriptable-tags04") << QStringLiteral(
+      "{% load scripteddefaults %}{% if2 foo %}yes{% else %}no{% endif2 %}")
+                                     << dict << QStringLiteral("no") << NoError;
 
   QTest::newRow("scriptable-tags05")
       << QStringLiteral("{% load scripteddefaults %}{{ boo|upper }}") << dict
diff -Naur grantlee-5.1.0/textdocument/lib/markupdirector.cpp grantlee/textdocument/lib/markupdirector.cpp
--- grantlee-5.1.0/textdocument/lib/markupdirector.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/textdocument/lib/markupdirector.cpp	2019-07-09 09:53:47.150090738 -0500
@@ -261,7 +261,7 @@
         //                                blockFormat.bottomMargin(),
         //                                blockFormat.leftMargin(),
         //                                blockFormat.rightMargin()
-        );
+    );
   }
 
   while (!it.atEnd()) {
@@ -671,25 +671,29 @@
   auto superscript = (vAlign == QTextCharFormat::AlignSuperScript);
   auto subscript = (vAlign == QTextCharFormat::AlignSubScript);
 
-  if (!fontStrikeout && (d->m_openElements.contains(StrikeOut)
-                         || d->m_elementsToOpen.contains(StrikeOut))) {
+  if (!fontStrikeout
+      && (d->m_openElements.contains(StrikeOut)
+          || d->m_elementsToOpen.contains(StrikeOut))) {
     closedElements.insert(StrikeOut);
   }
 
-  if (!fontUnderline && (d->m_openElements.contains(Underline)
-                         || d->m_elementsToOpen.contains(Underline))
+  if (!fontUnderline
+      && (d->m_openElements.contains(Underline)
+          || d->m_elementsToOpen.contains(Underline))
       && !(d->m_openElements.contains(Anchor)
            || d->m_elementsToOpen.contains(Anchor))) {
     closedElements.insert(Underline);
   }
 
-  if (!fontItalic && (d->m_openElements.contains(Emph)
-                      || d->m_elementsToOpen.contains(Emph))) {
+  if (!fontItalic
+      && (d->m_openElements.contains(Emph)
+          || d->m_elementsToOpen.contains(Emph))) {
     closedElements.insert(Emph);
   }
 
-  if (fontWeight != QFont::Bold && (d->m_openElements.contains(Strong)
-                                    || d->m_elementsToOpen.contains(Strong))) {
+  if (fontWeight != QFont::Bold
+      && (d->m_openElements.contains(Strong)
+          || d->m_elementsToOpen.contains(Strong))) {
     closedElements.insert(Strong);
   }
 
@@ -726,13 +730,15 @@
     closedElements.insert(Anchor);
   }
 
-  if (!subscript && (d->m_openElements.contains(SubScript)
-                     || d->m_elementsToOpen.contains(SubScript))) {
+  if (!subscript
+      && (d->m_openElements.contains(SubScript)
+          || d->m_elementsToOpen.contains(SubScript))) {
     closedElements.insert(SubScript);
   }
 
-  if (!superscript && (d->m_openElements.contains(SuperScript)
-                       || d->m_elementsToOpen.contains(SuperScript))) {
+  if (!superscript
+      && (d->m_openElements.contains(SuperScript)
+          || d->m_elementsToOpen.contains(SuperScript))) {
     closedElements.insert(SuperScript);
   }
   return closedElements;
@@ -825,8 +831,8 @@
   if (fontUnderline && !(d->m_openElements.contains(Underline))
       && !(d->m_openElements.contains(Anchor)
            || d->m_elementsToOpen.contains(
-                  Anchor)) // Can't change the underline state of a link.
-      ) {
+               Anchor)) // Can't change the underline state of a link.
+  ) {
     d->m_elementsToOpen.insert(Underline);
   }
 
diff -Naur grantlee-5.1.0/textdocument/lib/texthtmlbuilder.cpp grantlee/textdocument/lib/texthtmlbuilder.cpp
--- grantlee-5.1.0/textdocument/lib/texthtmlbuilder.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/textdocument/lib/texthtmlbuilder.cpp	2019-07-09 09:53:47.150090738 -0500
@@ -399,7 +399,8 @@
 {
   Q_D(TextHTMLBuilder);
   d->m_text.append(
-      QStringLiteral("<table cellpadding=\"%1\" cellspacing=\"%2\" width=\"%3\" border=\"1\">")
+      QStringLiteral("<table cellpadding=\"%1\" cellspacing=\"%2\" "
+                     "width=\"%3\" border=\"1\">")
           .arg(cellpadding)
           .arg(cellspacing)
           .arg(width));
diff -Naur grantlee-5.1.0/textdocument/tests/htmlbuildertest.cpp grantlee/textdocument/tests/htmlbuildertest.cpp
--- grantlee-5.1.0/textdocument/tests/htmlbuildertest.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/textdocument/tests/htmlbuildertest.cpp	2019-07-09 09:53:47.151090719 -0500
@@ -90,7 +90,9 @@
   md->processDocument(doc);
   auto result = hb->getResult();
   QRegularExpression regex(
-      QStringLiteral("^<p>Some (<strong><em>|<em><strong>)formatted(</em></strong>|</strong></em>) text.</p>\\n$"));
+      QStringLiteral("^<p>Some "
+                     "(<strong><em>|<em><strong>)formatted(</em></strong>|</"
+                     "strong></em>) text.</p>\\n$"));
 
   QVERIFY(regex.match(result).hasMatch());
 }
@@ -123,7 +125,9 @@
   md->processDocument(doc);
   auto result = hb->getResult();
 
-  QRegularExpression regex(QStringLiteral("^<p>A <a href=\"http://www.kde.org\"><strong>formatted</strong> link</a> to KDE.</p>\\n$"));
+  QRegularExpression regex(QStringLiteral(
+      "^<p>A <a href=\"http://www.kde.org\"><strong>formatted</strong> "
+      "link</a> to KDE.</p>\\n$"));
 
   QVERIFY(regex.match(result).hasMatch());
 }
@@ -132,14 +136,17 @@
 {
   auto doc = new QTextDocument();
   doc->setHtml(
-      QStringLiteral("Two <a href=\"http://www.kde.org\">links</a><a href=\"http://www.google.com\">next</a> to eachother."));
+      QStringLiteral("Two <a href=\"http://www.kde.org\">links</a><a "
+                     "href=\"http://www.google.com\">next</a> to eachother."));
 
   auto hb = new TextHTMLBuilder();
   auto md = new MarkupDirector(hb);
   md->processDocument(doc);
   auto result = hb->getResult();
 
-  QRegularExpression regex(QStringLiteral("^<p>Two <a href=\"http://www.kde.org\">links</a><a href=\"http://www.google.com\">next</a> to eachother.</p>\\n$"));
+  QRegularExpression regex(QStringLiteral(
+      "^<p>Two <a href=\"http://www.kde.org\">links</a><a "
+      "href=\"http://www.google.com\">next</a> to eachother.</p>\\n$"));
 
   QVERIFY(regex.match(result).hasMatch());
 }
@@ -172,7 +179,8 @@
   auto result = hb->getResult();
 
   auto regex = QRegularExpression(
-      QStringLiteral("^<p>Some <span style=\"color:#ff0000;\">formatted</span> text.</p>\\n$"));
+      QStringLiteral("^<p>Some <span style=\"color:#ff0000;\">formatted</span> "
+                     "text.</p>\\n$"));
 
   QVERIFY(regex.match(result).hasMatch());
 }
@@ -180,14 +188,20 @@
 void TestHtmlOutput::testDoubleSpan()
 {
   auto doc = new QTextDocument();
-  doc->setHtml(QStringLiteral("Some <span style=\"color:#ff0000;background-color:#00ff00;\">formatted</span> text."));
+  doc->setHtml(QStringLiteral("Some <span "
+                              "style=\"color:#ff0000;background-color:#00ff00;"
+                              "\">formatted</span> text."));
 
   auto hb = new TextHTMLBuilder();
   auto md = new MarkupDirector(hb);
   md->processDocument(doc);
   auto result = hb->getResult();
 
-  auto regex = QRegularExpression(QStringLiteral("^<p>Some <span style=\"(color:#ff0000|background-color:#00ff00);\"><span style=\"(color:#ff0000|background-color:#00ff00);\">formatted</span></span> text.</p>\\n$"));
+  auto regex = QRegularExpression(QStringLiteral(
+      "^<p>Some <span "
+      "style=\"(color:#ff0000|background-color:#00ff00);\"><span "
+      "style=\"(color:#ff0000|background-color:#00ff00);\">formatted</span></"
+      "span> text.</p>\\n$"));
 
   QVERIFY(regex.match(result).hasMatch());
 }
@@ -195,14 +209,18 @@
 void TestHtmlOutput::testSpanNesting()
 {
   auto doc = new QTextDocument();
-  doc->setHtml(QStringLiteral("Paragraph <span style=\"background-color:#00ff00;\">with some <span style=\"color:#ff0000;\">formatted</span> nested</span> text."));
+  doc->setHtml(QStringLiteral(
+      "Paragraph <span style=\"background-color:#00ff00;\">with some <span "
+      "style=\"color:#ff0000;\">formatted</span> nested</span> text."));
 
   auto hb = new TextHTMLBuilder();
   auto md = new MarkupDirector(hb);
   md->processDocument(doc);
   auto result = hb->getResult();
 
-  auto regex = QRegularExpression(QStringLiteral("^<p>Paragraph <span style=\"background-color:#00ff00;\">with some <span style=\"color:#ff0000;\">formatted</span> nested</span> text.</p>\\n$"));
+  auto regex = QRegularExpression(QStringLiteral(
+      "^<p>Paragraph <span style=\"background-color:#00ff00;\">with some <span "
+      "style=\"color:#ff0000;\">formatted</span> nested</span> text.</p>\\n$"));
 
   QVERIFY(regex.match(result).hasMatch());
 }
@@ -219,7 +237,8 @@
   auto result = hb->getResult();
 
   auto regex = QRegularExpression(
-      QStringLiteral("^<p>Paragraph <em><strong>with</strong> some formatted</em> text.</p>\\n$"));
+      QStringLiteral("^<p>Paragraph <em><strong>with</strong> some "
+                     "formatted</em> text.</p>\\n$"));
 
   QVERIFY(regex.match(result).hasMatch());
 }
@@ -236,7 +255,8 @@
   auto result = hb->getResult();
 
   auto regex = QRegularExpression(
-      QStringLiteral("^<p>Paragraph <strong><em>with</em> some formatted</strong> text.</p>\\n$"));
+      QStringLiteral("^<p>Paragraph <strong><em>with</em> some "
+                     "formatted</strong> text.</p>\\n$"));
 
   QVERIFY(regex.match(result).hasMatch());
 }
@@ -253,7 +273,8 @@
   auto result = hb->getResult();
 
   auto regex = QRegularExpression(
-      QStringLiteral("^<p>Paragraph <em>with some <strong>formatted</strong></em> text.</p>\\n$"));
+      QStringLiteral("^<p>Paragraph <em>with some "
+                     "<strong>formatted</strong></em> text.</p>\\n$"));
 
   QVERIFY(regex.match(result).hasMatch());
 }
@@ -270,7 +291,8 @@
   auto result = hb->getResult();
 
   auto regex = QRegularExpression(
-      QStringLiteral("^<p>Paragraph <strong>with some <em>formatted</em></strong> text.</p>\\n$"));
+      QStringLiteral("^<p>Paragraph <strong>with some "
+                     "<em>formatted</em></strong> text.</p>\\n$"));
 
   QVERIFY(regex.match(result).hasMatch());
 }
@@ -287,7 +309,8 @@
   auto result = hb->getResult();
 
   auto regex = QRegularExpression(
-      QStringLiteral("^<p>Paragraph <strong>with <em>some</em></strong><em> formatted</em> text.</p>\\n$"));
+      QStringLiteral("^<p>Paragraph <strong>with <em>some</em></strong><em> "
+                     "formatted</em> text.</p>\\n$"));
 
   QVERIFY(regex.match(result).hasMatch());
 }
@@ -328,7 +351,8 @@
 {
   auto doc = new QTextDocument();
   doc->setHtml(
-      QStringLiteral("Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" /> image."));
+      QStringLiteral("Paragraph with an inline <img "
+                     "src=\"http://kde.org/img/kde41.png\" /> image."));
 
   auto hb = new TextHTMLBuilder();
   auto md = new MarkupDirector(hb);
@@ -336,7 +360,8 @@
   auto result = hb->getResult();
 
   auto regex = QRegularExpression(
-      QStringLiteral("^<p>Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" /> image.</p>\\n$"));
+      QStringLiteral("^<p>Paragraph with an inline <img "
+                     "src=\"http://kde.org/img/kde41.png\" /> image.</p>\\n$"));
 
   QVERIFY(regex.match(result).hasMatch());
 }
@@ -350,36 +375,48 @@
   auto doc = new QTextDocument();
 
   // width
-  doc->setHtml(QStringLiteral("Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" width=\"10\" /> image."));
+  doc->setHtml(QStringLiteral(
+      "Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" "
+      "width=\"10\" /> image."));
 
   hb = new TextHTMLBuilder();
   md = new MarkupDirector(hb);
   md->processDocument(doc);
   result = hb->getResult();
 
-  regex = QRegularExpression(QStringLiteral("^<p>Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" width=\"10\" /> image.</p>\\n$"));
+  regex = QRegularExpression(QStringLiteral(
+      "^<p>Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" "
+      "width=\"10\" /> image.</p>\\n$"));
   QVERIFY(regex.match(result).hasMatch());
 
   // height
-  doc->setHtml(QStringLiteral("Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" height=\"10\" /> image."));
+  doc->setHtml(QStringLiteral(
+      "Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" "
+      "height=\"10\" /> image."));
 
   hb = new TextHTMLBuilder();
   md = new MarkupDirector(hb);
   md->processDocument(doc);
   result = hb->getResult();
 
-  regex = QRegularExpression(QStringLiteral("^<p>Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" height=\"10\" /> image.</p>\\n$"));
+  regex = QRegularExpression(QStringLiteral(
+      "^<p>Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" "
+      "height=\"10\" /> image.</p>\\n$"));
   QVERIFY(regex.match(result).hasMatch());
 
   // height and width
-  doc->setHtml(QStringLiteral("Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" height=\"10\" width=\"10\" /> image."));
+  doc->setHtml(QStringLiteral(
+      "Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" "
+      "height=\"10\" width=\"10\" /> image."));
 
   hb = new TextHTMLBuilder();
   md = new MarkupDirector(hb);
   md->processDocument(doc);
   result = hb->getResult();
 
-  regex = QRegularExpression(QStringLiteral("^<p>Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" width=\"10\" height=\"10\" /> image.</p>\\n$"));
+  regex = QRegularExpression(QStringLiteral(
+      "^<p>Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" "
+      "width=\"10\" height=\"10\" /> image.</p>\\n$"));
 
   QVERIFY(regex.match(result).hasMatch());
 }
@@ -467,7 +504,8 @@
   result = hb->getResult();
 
   regex = QRegularExpression(
-      QStringLiteral("^<p>Some <span style=\"color:#ff0000;\">formatted</span> text.</p>\\n$"));
+      QStringLiteral("^<p>Some <span style=\"color:#ff0000;\">formatted</span> "
+                     "text.</p>\\n$"));
   QVERIFY(regex.match(result).hasMatch());
 
   // Test Background
@@ -478,7 +516,9 @@
   md->processDocument(doc);
   result = hb->getResult();
 
-  regex = QRegularExpression(QStringLiteral("^<p>Some <span style=\"background-color:#ff0000;\">formatted</span> text.</p>\\n$"));
+  regex = QRegularExpression(QStringLiteral(
+      "^<p>Some <span style=\"background-color:#ff0000;\">formatted</span> "
+      "text.</p>\\n$"));
   QVERIFY(regex.match(result).hasMatch());
 
   // Test Font Family
@@ -489,7 +529,9 @@
   md->processDocument(doc);
   result = hb->getResult();
 
-  regex = QRegularExpression(QStringLiteral("^<p>Some <span style=\"font-family:courier;\">formatted</span> text.</p>\\n$"));
+  regex = QRegularExpression(QStringLiteral(
+      "^<p>Some <span style=\"font-family:courier;\">formatted</span> "
+      "text.</p>\\n$"));
   QVERIFY(regex.match(result).hasMatch());
 
   // Test Font Size
@@ -500,7 +542,9 @@
   md->processDocument(doc);
   result = hb->getResult();
 
-  regex = QRegularExpression(QStringLiteral("^<p>Some <span style=\"font-size:20pt;\">formatted</span> text.</p>\\n$"));
+  regex = QRegularExpression(QStringLiteral(
+      "^<p>Some <span style=\"font-size:20pt;\">formatted</span> "
+      "text.</p>\\n$"));
   QVERIFY(regex.match(result).hasMatch());
 }
 
@@ -508,7 +552,8 @@
 {
   auto doc = new QTextDocument();
   doc->setHtml(
-      QStringLiteral("<p style=\"margin-top:0;margin-bottom:0;\">Foo</p><hr /><p style=\"margin-top:0;margin-bottom:0;\">Bar</p>"));
+      QStringLiteral("<p style=\"margin-top:0;margin-bottom:0;\">Foo</p><hr "
+                     "/><p style=\"margin-top:0;margin-bottom:0;\">Bar</p>"));
 
   auto hb = new TextHTMLBuilder();
   auto md = new MarkupDirector(hb);
diff -Naur grantlee-5.1.0/textdocument/tests/plainmarkupbuildertest.cpp grantlee/textdocument/tests/plainmarkupbuildertest.cpp
--- grantlee-5.1.0/textdocument/tests/plainmarkupbuildertest.cpp	2016-04-19 01:33:17.000000000 -0500
+++ grantlee/textdocument/tests/plainmarkupbuildertest.cpp	2019-07-09 09:53:47.151090719 -0500
@@ -130,7 +130,8 @@
   auto result = hb->getResult();
 
   QRegularExpression regex(
-      QStringLiteral("^A \\*formatted\\* link\\[1\\] to KDE.\\n\\n--------\\n\\[1\\] http://www.kde.org\\n$"));
+      QStringLiteral("^A \\*formatted\\* link\\[1\\] to "
+                     "KDE.\\n\\n--------\\n\\[1\\] http://www.kde.org\\n$"));
 
   QVERIFY(regex.match(result).hasMatch());
 }
@@ -139,14 +140,17 @@
 {
   auto doc = new QTextDocument();
   doc->setHtml(
-      QStringLiteral("Two <a href=\"http://www.kde.org\">links</a><a href=\"http://www.google.com\">next</a> to eachother."));
+      QStringLiteral("Two <a href=\"http://www.kde.org\">links</a><a "
+                     "href=\"http://www.google.com\">next</a> to eachother."));
 
   auto hb = new PlainTextMarkupBuilder();
   auto md = new MarkupDirector(hb);
   md->processDocument(doc);
   auto result = hb->getResult();
 
-  QRegularExpression regex(QStringLiteral("^Two links\\[1\\]next\\[2\\] to eachother.\\n\\n--------\\n\\[1\\] http://www.kde.org\\n\\[2\\] http://www.google.com\\n$"));
+  QRegularExpression regex(QStringLiteral(
+      "^Two links\\[1\\]next\\[2\\] to eachother.\\n\\n--------\\n\\[1\\] "
+      "http://www.kde.org\\n\\[2\\] http://www.google.com\\n$"));
 
   QVERIFY(regex.match(result).hasMatch());
 }
@@ -186,7 +190,9 @@
 void TestPlainMarkupOutput::testDoubleSpan()
 {
   auto doc = new QTextDocument();
-  doc->setHtml(QStringLiteral("Some <span style=\"color:#ff0000;background-color:#00ff00;\">formatted</span> text."));
+  doc->setHtml(QStringLiteral("Some <span "
+                              "style=\"color:#ff0000;background-color:#00ff00;"
+                              "\">formatted</span> text."));
 
   auto hb = new PlainTextMarkupBuilder();
   auto md = new MarkupDirector(hb);
@@ -201,7 +207,9 @@
 void TestPlainMarkupOutput::testSpanNesting()
 {
   auto doc = new QTextDocument();
-  doc->setHtml(QStringLiteral("Paragraph <span style=\"background-color:#00ff00;\">with some <span style=\"color:#ff0000;\">formatted</span> nested</span> text."));
+  doc->setHtml(QStringLiteral(
+      "Paragraph <span style=\"background-color:#00ff00;\">with some <span "
+      "style=\"color:#ff0000;\">formatted</span> nested</span> text."));
 
   auto hb = new PlainTextMarkupBuilder();
   auto md = new MarkupDirector(hb);
@@ -335,14 +343,17 @@
 {
   auto doc = new QTextDocument();
   doc->setHtml(
-      QStringLiteral("Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" /> image."));
+      QStringLiteral("Paragraph with an inline <img "
+                     "src=\"http://kde.org/img/kde41.png\" /> image."));
 
   auto hb = new PlainTextMarkupBuilder();
   auto md = new MarkupDirector(hb);
   md->processDocument(doc);
   auto result = hb->getResult();
 
-  auto regex = QRegularExpression(QStringLiteral("^Paragraph with an inline \\[1\\] image.\\n\\n--------\\n\\[1\\] http://kde.org/img/kde41.png\\n$"));
+  auto regex = QRegularExpression(QStringLiteral(
+      "^Paragraph with an inline \\[1\\] image.\\n\\n--------\\n\\[1\\] "
+      "http://kde.org/img/kde41.png\\n$"));
 
   QVERIFY(regex.match(result).hasMatch());
 }
@@ -356,36 +367,48 @@
   auto doc = new QTextDocument();
 
   // width
-  doc->setHtml(QStringLiteral("Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" width=\"10\" /> image."));
+  doc->setHtml(QStringLiteral(
+      "Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" "
+      "width=\"10\" /> image."));
 
   hb = new PlainTextMarkupBuilder();
   md = new MarkupDirector(hb);
   md->processDocument(doc);
   result = hb->getResult();
 
-  regex = QRegularExpression(QStringLiteral("^Paragraph with an inline \\[1\\] image.\\n\\n--------\\n\\[1\\] http://kde.org/img/kde41.png\\n$"));
+  regex = QRegularExpression(QStringLiteral(
+      "^Paragraph with an inline \\[1\\] image.\\n\\n--------\\n\\[1\\] "
+      "http://kde.org/img/kde41.png\\n$"));
   QVERIFY(regex.match(result).hasMatch());
 
   // height
-  doc->setHtml(QStringLiteral("Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" height=\"10\" /> image."));
+  doc->setHtml(QStringLiteral(
+      "Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" "
+      "height=\"10\" /> image."));
 
   hb = new PlainTextMarkupBuilder();
   md = new MarkupDirector(hb);
   md->processDocument(doc);
   result = hb->getResult();
 
-  regex = QRegularExpression(QStringLiteral("^Paragraph with an inline \\[1\\] image.\\n\\n--------\\n\\[1\\] http://kde.org/img/kde41.png\\n$"));
+  regex = QRegularExpression(QStringLiteral(
+      "^Paragraph with an inline \\[1\\] image.\\n\\n--------\\n\\[1\\] "
+      "http://kde.org/img/kde41.png\\n$"));
   QVERIFY(regex.match(result).hasMatch());
 
   // height and width
-  doc->setHtml(QStringLiteral("Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" height=\"10\" width=\"10\" /> image."));
+  doc->setHtml(QStringLiteral(
+      "Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" "
+      "height=\"10\" width=\"10\" /> image."));
 
   hb = new PlainTextMarkupBuilder();
   md = new MarkupDirector(hb);
   md->processDocument(doc);
   result = hb->getResult();
 
-  regex = QRegularExpression(QStringLiteral("^Paragraph with an inline \\[1\\] image.\\n\\n--------\\n\\[1\\] http://kde.org/img/kde41.png\\n$"));
+  regex = QRegularExpression(QStringLiteral(
+      "^Paragraph with an inline \\[1\\] image.\\n\\n--------\\n\\[1\\] "
+      "http://kde.org/img/kde41.png\\n$"));
 
   QVERIFY(regex.match(result).hasMatch());
 }
@@ -509,7 +532,8 @@
 {
   auto doc = new QTextDocument();
   doc->setHtml(
-      QStringLiteral("<p style=\"margin-top:0;margin-bottom:0;\">Foo</p><hr /><p style=\"margin-top:0;margin-bottom:0;\">Bar</p>"));
+      QStringLiteral("<p style=\"margin-top:0;margin-bottom:0;\">Foo</p><hr "
+                     "/><p style=\"margin-top:0;margin-bottom:0;\">Bar</p>"));
 
   auto hb = new PlainTextMarkupBuilder();
   auto md = new MarkupDirector(hb);
