We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99f921e commit 2287d33Copy full SHA for 2287d33
lib/plugins/leetcode.js
@@ -157,11 +157,12 @@ plugin.getProblem = function(problem, cb) {
157
158
problem.totalAC = JSON.parse(q.stats).totalAccepted;
159
problem.totalSubmit = JSON.parse(q.stats).totalSubmission;
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
- }
+
+ let content = q.translatedContent ? q.translatedContent : q.content;
+ // Replace <sup/> with '^' as the power operator
+ content = content.replace(/<\/sup>/gm, '').replace(/<sup>/gm, '^');
+ problem.desc = he.decode(cheerio.load(content).root().text());
165
166
problem.templates = JSON.parse(q.codeDefinition);
167
problem.testcase = q.sampleTestCase;
168
problem.testable = q.enableRunCode;
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments