@wg-npm/survey-creator 0.5.159 → 0.5.161

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.
@@ -595,12 +595,20 @@ function translate(obj, locale, prettyMath = false) {
595
595
  }
596
596
  return obj[ZH_CN] || obj["zh-CN"] || obj[EN_US] || obj["en-US"] || obj[ZH_TW] || obj["zh-TW"];
597
597
  }
598
+ const CUSTOM_INPUT_REG = /(_{5,})/g;
598
599
  function formatTitle(question, locale) {
599
600
  const title = translate(question.header.text, locale, true);
600
601
  if (!_.get(question, "options.richTextEnabled", false)) {
601
602
  return [title];
602
603
  }
603
- return title.split(/_{5,}/g);
604
+ const trimmedTitles = title.split(CUSTOM_INPUT_REG);
605
+ if (trimmedTitles[0] === "") {
606
+ trimmedTitles.splice(0, 1);
607
+ }
608
+ if (trimmedTitles[trimmedTitles.length - 1] === "") {
609
+ trimmedTitles.splice(trimmedTitles.length - 1, 1);
610
+ }
611
+ return trimmedTitles;
604
612
  }
605
613
  function showInput(index, formatTitle) {
606
614
  if (index === formatTitle.length - 2 && formatTitle[formatTitle.length - 1] === "") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wg-npm/survey-creator",
3
- "version": "0.5.159",
3
+ "version": "0.5.161",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -12,8 +12,8 @@
12
12
  "lint-fix": "eslint \"**/*.ts\" \"**/*.vue\" --fix --no-error-on-unmatched-pattern"
13
13
  },
14
14
  "peerDependencies": {
15
- "@wg-npm/survey-core": "0.5.159",
16
- "@wg-npm/survey-service-api": "0.5.159",
15
+ "@wg-npm/survey-core": "0.5.161",
16
+ "@wg-npm/survey-service-api": "0.5.161",
17
17
  "axios": "^0.19.2",
18
18
  "camelcase": "^6.0.0",
19
19
  "deepmerge": "^4.2.2",
@@ -38,8 +38,8 @@
38
38
  "@typescript-eslint/eslint-plugin": "^3.6.0",
39
39
  "@typescript-eslint/parser": "^3.6.0",
40
40
  "@vue/eslint-config-prettier": "^6.0.0",
41
- "@wg-npm/survey-core": "0.5.159",
42
- "@wg-npm/survey-service-api": "0.5.159",
41
+ "@wg-npm/survey-core": "0.5.161",
42
+ "@wg-npm/survey-service-api": "0.5.161",
43
43
  "acorn": "^7.3.1",
44
44
  "axios": "^0.19.2",
45
45
  "babelrc-rollup": "^3.0.0",