@clxmedia/clxforms-client 1.0.31 → 1.0.33

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.
@@ -73,8 +73,17 @@ const formatResponseValue = (response, question) => {
73
73
  case "STRING":
74
74
  if (typeof value === "string") {
75
75
  let cleanValue = value
76
- .replace(/<[^>]*>/g, "")
77
76
  .replace(/&nbsp;/g, " ")
77
+ .replace(/<br\s*\/?>/gi, " \n")
78
+ .replace(/<\/p>\s*<p[^>]*>/gi, "\n\n")
79
+ .replace(/<\/?p[^>]*>/gi, "")
80
+ .replace(/<\/?(?:strong|b)(?:\s[^>]*)?>([^<]*)/gi, "**$1")
81
+ .replace(/([^>]*)<\/(?:strong|b)>/gi, "$1**")
82
+ .replace(/<\/?(?:em|i)(?:\s[^>]*)?>([^<]*)/gi, "*$1")
83
+ .replace(/([^>]*)<\/(?:em|i)>/gi, "$1*")
84
+ .replace(/<a\s+href="([^"]*)"[^>]*>([^<]*)<\/a>/gi, "[$2]($1)")
85
+ .replace(/<[^>]*>/g, "")
86
+ .replace(/\s+/g, " ")
78
87
  .trim();
79
88
  if (((_b = (_a = question === null || question === void 0 ? void 0 : question.response_options) === null || _a === void 0 ? void 0 : _a.field) === null || _b === void 0 ? void 0 : _b.type) === "select" &&
80
89
  "options" in question.response_options.field &&
@@ -158,9 +167,8 @@ exports.CLXFormLayoutConvert = {
158
167
  return markdown;
159
168
  }
160
169
  layout.steps.forEach((step, stepIndex) => {
161
- markdown += `# ${stepIndex + 1}. ${step.name}\n\n`;
162
- if (step.description) {
163
- markdown += `*${step.description}*\n\n`;
170
+ if (layout.steps.length > 1) {
171
+ markdown += `# ${stepIndex + 1}. ${step.name}\n\n`;
164
172
  }
165
173
  step.sections.forEach((section) => {
166
174
  if (section.name) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clxmedia/clxforms-client",
3
- "version": "1.0.31",
3
+ "version": "1.0.33",
4
4
  "description": "CLXperience Forms Client",
5
5
  "author": "Brandon Thompson <brandont@clxmedia.com>",
6
6
  "license": "MIT",