@legalplace/prerenderx 2.3.51 → 2.3.53

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.
@@ -40,6 +40,7 @@ var OptionRender = (function () {
40
40
  var variables = OutputParser_1.getRelatedVariablesValues(this.id, this.index, outputReference.variables, this.ovc, this.references);
41
41
  var output = OutputParser_1.parseOutputWithVariables(option.meta.output, variables, autonums);
42
42
  output = output.replace(/>([\n\s]+)</g, '><');
43
+ output = output.replace(/\n/g, '<br />');
43
44
  output = output.replace(/\xA0/g, ' ');
44
45
  this.outputs.push(output);
45
46
  }
@@ -35,6 +35,7 @@ exports.parseOutputWithVariables = function (output, variables, autonums) {
35
35
  if (value.trim().length === 0) {
36
36
  value = new Array(16).join('_');
37
37
  }
38
+ value = value.replace(/\n/g, '<br />');
38
39
  parsedOutput = parsedOutput.replace(new RegExp("\\[var:" + variableId + "\\]", 'g'), value);
39
40
  });
40
41
  parsedOutput = parsedOutput.replace(/\[\[PAGE_BREAK\]\]/gi, '<div style="page-break-after:always"></div>');
@@ -6,6 +6,7 @@ declare type DocumentOutputIndex = {
6
6
  slug: string;
7
7
  pdf: boolean;
8
8
  docx: boolean;
9
+ displayed: boolean;
9
10
  };
10
11
  declare type DocumentPdfFormIndex = {
11
12
  name: string;
@@ -36,7 +36,7 @@ var Prerender = (function () {
36
36
  Prerender.prototype.generateDocumentNamesHash = function () {
37
37
  var _this = this;
38
38
  Object.keys(this.model.documents).forEach(function (documentName) {
39
- var _a, _b;
39
+ var _a, _b, _c;
40
40
  var document = _this.model.documents[documentName];
41
41
  var documentParams = _this.model.documents[documentName].params;
42
42
  var conditionObject = _this.references.conditions.documents[documentName];
@@ -63,7 +63,8 @@ var Prerender = (function () {
63
63
  name: document.name,
64
64
  slug: documentName,
65
65
  pdf: ((_a = documentParams === null || documentParams === void 0 ? void 0 : documentParams.formats) === null || _a === void 0 ? void 0 : _a.pdf) === undefined ? true : documentParams.formats.pdf,
66
- docx: ((_b = documentParams === null || documentParams === void 0 ? void 0 : documentParams.formats) === null || _b === void 0 ? void 0 : _b.docx) === undefined ? true : documentParams.formats.docx
66
+ docx: ((_b = documentParams === null || documentParams === void 0 ? void 0 : documentParams.formats) === null || _b === void 0 ? void 0 : _b.docx) === undefined ? true : documentParams.formats.docx,
67
+ displayed: ((_c = documentParams === null || documentParams === void 0 ? void 0 : documentParams.visibility) === null || _c === void 0 ? void 0 : _c.displayBo) === true ? true : false
67
68
  };
68
69
  }
69
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legalplace/prerenderx",
3
- "version": "2.3.51",
3
+ "version": "2.3.53",
4
4
  "description": "PrerenderX",
5
5
  "main": "dist/index.js",
6
6
  "repository": "https://git.legalplace.eu/legalplace/prerenderx",
@@ -61,8 +61,8 @@ class OptionRender {
61
61
  // Removing spaces between tags
62
62
  output = output.replace(/>([\n\s]+)</g, '><');
63
63
 
64
- // Replacing \n with line-break
65
- // output = output.replace(/\n/g, '<br />')
64
+ // Replacing \n with line-break
65
+ output = output.replace(/\n/g, '<br />')
66
66
 
67
67
  // Cleaning \xA0
68
68
  output = output.replace(/\xA0/g, ' ')
@@ -64,6 +64,9 @@ export const parseOutputWithVariables: parseOutputT = (output, variables, autonu
64
64
  if (value.trim().length === 0) {
65
65
  value = new Array(16).join('_')
66
66
  }
67
+
68
+ // Replacing linebreaks with br tags
69
+ value = value.replace(/\n/g, '<br />')
67
70
  parsedOutput = parsedOutput.replace(new RegExp(`\\[var:${variableId}\\]`, 'g'), value)
68
71
  })
69
72
 
@@ -14,6 +14,7 @@ type DocumentOutputIndex = {
14
14
  slug: string
15
15
  pdf: boolean
16
16
  docx: boolean
17
+ displayed: boolean
17
18
  }
18
19
  type DocumentPdfFormIndex = {
19
20
  name: string
@@ -121,7 +122,8 @@ class Prerender {
121
122
  name: document.name,
122
123
  slug: documentName,
123
124
  pdf: documentParams?.formats?.pdf === undefined ? true : documentParams.formats.pdf,
124
- docx: documentParams?.formats?.docx === undefined ? true : documentParams.formats.docx
125
+ docx: documentParams?.formats?.docx === undefined ? true : documentParams.formats.docx,
126
+ displayed: documentParams?.visibility?.displayBo === true ? true : false
125
127
  }
126
128
  }
127
129
  }