Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 54ba41e

Browse files
authored
get translatedContent
1 parent 1cee26c commit 54ba41e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎lib/plugins/leetcode.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ plugin.getProblem = function(problem, cb) {
137137
' sampleTestCase',
138138
' enableRunCode',
139139
' metaData',
140+
' translatedContent',
140141
' discussCategoryId',
141142
' }',
142143
'}'
@@ -156,7 +157,11 @@ plugin.getProblem = function(problem, cb) {
156157

157158
problem.totalAC = JSON.parse(q.stats).totalAccepted;
158159
problem.totalSubmit = JSON.parse(q.stats).totalSubmission;
159-
problem.desc = he.decode(cheerio.load(q.content).root().text());
160+
if (!q.translatedContent) {
161+
problem.desc = he.decode(cheerio.load(q.content).root().text());
162+
}else{
163+
problem.desc = he.decode(cheerio.load(q.translatedContent).root().text());
164+
}
160165
problem.templates = JSON.parse(q.codeDefinition);
161166
problem.testcase = q.sampleTestCase;
162167
problem.testable = q.enableRunCode;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /