Skip to content

Commit bb09530

Browse files
authored
Merge pull request skygragon#98 from EINDEX/master
support translatedContent test on leetcode-cn.com
2 parents 1cee26c + 54ba41e commit bb09530

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy