Skip to content

Commit 546a6cd

Browse files
committed
fix a issue: using jq -r to query the raw information
1 parent d3dd701 commit 546a6cd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/lib/query_problem.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ function query_problem_jq()
4848
{
4949
QUESTION_CONTENT=$(jq -r '.data.question.content' ${TMP_JSON_FILE} | sed -e 's/<sup>/\^/g' | sed -e 's/<[^>]*>//g; s/&nbsp;/ /g; s/&amp;/\&/g; s/&lt;/\</g; s/&gt;/\>/g; s/&quot;/\"/g; s/&#39;/\'"'"'/g; s/&ldquo;/\"/g;')
5050

51-
QUESTION_DIFFICULTY=$(jq '.data.question.difficulty' ${TMP_JSON_FILE})
51+
QUESTION_DIFFICULTY=$(jq -r '.data.question.difficulty' ${TMP_JSON_FILE})
5252

53-
QUESTION_TITLE=$(jq '.data.question.title' ${TMP_JSON_FILE})
53+
QUESTION_TITLE=$(jq -r '.data.question.title' ${TMP_JSON_FILE})
5454

55-
QUESTION_ID=$(jq '.data.question.questionId' ${TMP_JSON_FILE})
56-
57-
QUESTION_FRONTEND_ID=$(jq '.data.question.questionFrontendId' ${TMP_JSON_FILE})
55+
QUESTION_ID=$(jq -r '.data.question.questionId' ${TMP_JSON_FILE})
5856

57+
QUESTION_FRONTEND_ID=$(jq -r '.data.question.questionFrontendId' ${TMP_JSON_FILE})
58+
5959
}
6060

6161
function query_problem()

0 commit comments

Comments
 (0)