isite 2025.1.12 → 2025.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/parser.js CHANGED
@@ -811,6 +811,7 @@ module.exports = function init(req, res, ____0, route) {
811
811
 
812
812
  parser.handleMatches = function (txt) {
813
813
  let matches = txt.match(/##.*?##/g);
814
+ let handled = false;
814
815
  if (matches) {
815
816
  for (let i = 0; i < matches.length; i++) {
816
817
  let v = matches[i];
@@ -818,40 +819,54 @@ module.exports = function init(req, res, ____0, route) {
818
819
  if (v.startsWith('##var.')) {
819
820
  v = v.replace('##var.', '').replace('##', '');
820
821
  txt = txt.replace(matches[i], renderVar(v));
822
+ handled = true;
821
823
  } else if (v.startsWith('##user.')) {
822
824
  v = v.replace('##user.', '').replace('##', '');
823
825
  txt = txt.replace(matches[i], renderUser(v));
826
+ handled = true;
824
827
  } else if (v.startsWith('##site.')) {
825
828
  v = v.replace('##site.', '').replace('##', '');
826
829
  txt = txt.replace(matches[i], render_site(v));
830
+ handled = true;
827
831
  } else if (v.startsWith('##req.')) {
828
832
  v = v.replace('##req.', '').replace('##', '');
829
833
  txt = txt.replace(matches[i], renderRequest(v));
834
+ handled = true;
830
835
  } else if (v.startsWith('##session.')) {
831
836
  v = v.replace('##session.', '').replace('##', '');
832
837
  txt = txt.replace(matches[i], renderSession(v));
838
+ handled = true;
833
839
  } else if (v.startsWith('##json.')) {
834
840
  v = v.replace('##json.', '').replace('##', '');
835
841
  txt = txt.replace(matches[i], renderJson(v));
842
+ handled = true;
836
843
  } else if (v.startsWith('##setting.')) {
837
844
  v = v.replace('##setting.', '').replace('##', '');
838
845
  txt = txt.replace(matches[i], renderSetting(v));
846
+ handled = true;
839
847
  } else if (v.startsWith('##params.')) {
840
848
  v = v.replace('##params.', '').replace('##', '');
841
849
  txt = txt.replace(matches[i], renderParam(v));
850
+ handled = true;
842
851
  } else if (v.startsWith('##query.')) {
843
852
  v = v.replace('##query.', '').replace('##', '');
844
853
  txt = txt.replace(matches[i], renderQuery(v));
854
+ handled = true;
845
855
  } else if (v.startsWith('##data.')) {
846
856
  v = v.replace('##data.', '').replace('##', '');
847
857
  txt = txt.replace(matches[i], renderData(v));
858
+ handled = true;
848
859
  } else if (v.startsWith('##word.')) {
849
860
  v = v.replace('##word.', '').replace('##', '');
850
861
  txt = txt.replace(matches[i], renderWord(v));
862
+ handled = true;
851
863
  } else {
852
864
  }
853
865
  }
854
866
  }
867
+ if (handled) {
868
+ txt = parser.handleMatches(txt);
869
+ }
855
870
  return txt;
856
871
  };
857
872