@legalplace/prerenderx 2.3.52 → 2.3.54

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,7 +6,6 @@ declare type DocumentOutputIndex = {
6
6
  slug: string;
7
7
  pdf: boolean;
8
8
  docx: boolean;
9
- displayed: boolean;
10
9
  };
11
10
  declare type DocumentPdfFormIndex = {
12
11
  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, _c;
39
+ var _a, _b;
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,8 +63,7 @@ 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,
67
- displayed: ((_c = documentParams === null || documentParams === void 0 ? void 0 : documentParams.visibility) === null || _c === void 0 ? void 0 : _c.displayBo) === true ? true : false
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
68
67
  };
69
68
  }
70
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legalplace/prerenderx",
3
- "version": "2.3.52",
3
+ "version": "2.3.54",
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,7 +14,6 @@ type DocumentOutputIndex = {
14
14
  slug: string
15
15
  pdf: boolean
16
16
  docx: boolean
17
- displayed: boolean
18
17
  }
19
18
  type DocumentPdfFormIndex = {
20
19
  name: string
@@ -122,8 +121,7 @@ class Prerender {
122
121
  name: document.name,
123
122
  slug: documentName,
124
123
  pdf: documentParams?.formats?.pdf === undefined ? true : documentParams.formats.pdf,
125
- docx: documentParams?.formats?.docx === undefined ? true : documentParams.formats.docx,
126
- displayed: documentParams?.visibility?.displayBo === true ? true : false
124
+ docx: documentParams?.formats?.docx === undefined ? true : documentParams.formats.docx
127
125
  }
128
126
  }
129
127
  }