8000 Merge branch 'master' of https://github.com/skygragon/leetcode-cli · 15cm/leetcode-cli@f955512 · GitHub
[go: up one dir, main page]

Skip to content

Commit f955512

Browse files
committed
2 parents d1c2a67 + 8ab0ec8 commit f955512

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/plugins/leetcode.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ plugin.getProblem = function(problem, cb) {
137137
' sampleTestCase',
138138
' enableRunCode',
139139
' metaData',
140-
' discussCategoryId',
140+
' translatedContent',
141141
' }',
142142
'}'
143143
].join('\n'),
@@ -156,12 +156,17 @@ plugin.getProblem = function(problem, cb) {
156156

157157
problem.totalAC = JSON.parse(q.stats).totalAccepted;
158158
problem.totalSubmit = JSON.parse(q.stats).totalSubmission;
159-
problem.desc = he.decode(cheerio.load(q.content).root().text());
159+
if (!q.translatedContent) {
160+
problem.desc = he.decode(cheerio.load(q.content).root().text());
161+
}else{
162+
problem.desc = he.decode(cheerio.load(q.translatedContent).root().text());
163+
}
160164
problem.templates = JSON.parse(q.codeDefinition);
161165
problem.testcase = q.sampleTestCase;
162166
problem.testable = q.enableRunCode;
163167
problem.templateMeta = JSON.parse(q.metaData);
164-
problem.discuss = q.discussCategoryId;
168+
// @si-yao: seems below property is never used.
169+
//problem.discuss = q.discussCategoryId;
165170

166171
return cb(null, problem);
167172
});

0 commit comments

Comments
 (0)
0