Skip to content

Commit 1450fa9

Browse files
committed
fix last version - it wasnt built
1 parent f9f88d7 commit 1450fa9

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "traitify-widgets",
3-
"version": "3.5.4",
3+
"version": "3.5.6",
44
"description": "Traitiy Widgets",
55
"repository": {
66
"type": "git",

src/components/results/guide/personality/question.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ import Icon from "components/common/icon";
55
import Markdown from "components/common/markdown";
66
import style from "./style.scss";
77

8+
function parseQuestionText(text) {
9+
if(!text) return {introduction: "", numberWithLabel: "", text: ""};
10+
11+
try {
12+
const [introduction, ...content] = text.split("\n\n\n");
13+
const [numberWithLabel, ...remainingText] = content.join("\n\n\n").split(":");
14+
const questionText = remainingText.join(":").trim();
15+
16+
return {introduction, numberWithLabel, text: questionText};
17+
} catch(error) {
18+
console.error("Error parsing question text:", {text, error});
19+
return {introduction: "", numberWithLabel: "", text: ""};
20+
}
21+
}
22+
823
function Question({question}) {
924
const [showContent, setShowContent] = useState(false);
1025
const parsedText = parseQuestionText(question.text);
@@ -41,21 +56,6 @@ function Question({question}) {
4156
);
4257
}
4358

44-
function parseQuestionText(text) {
45-
if (!text) return { introduction: "", numberWithLabel: "", text: "" };
46-
47-
try {
48-
const [introduction, ...content] = text.split("\n\n\n");
49-
const [numberWithLabel, ...remainingText] = content.join("\n\n\n").split(":");
50-
const questionText = remainingText.join(":").trim();
51-
52-
return { introduction, numberWithLabel, text: questionText };
53-
} catch (error) {
54-
console.error("Error parsing question text:", { text, error });
55-
return { introduction: "", numberWithLabel: "", text: "" };
56-
}
57-
}
58-
5959
Question.propTypes = {
6060
question: PropTypes.shape({
6161
adaptability: PropTypes.string,

0 commit comments

Comments
 (0)