File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -157,11 +157,12 @@ plugin.getProblem = function(problem, cb) {
157
157
158
158
problem . totalAC = JSON . parse ( q . stats ) . totalAccepted ;
159
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
- }
160
+
161
+ let content = q . translatedContent ? q . translatedContent : q . content ;
162
+ // Replace <sup/> with '^' as the power operator
163
+ content = content . replace ( / < \/ s u p > / gm, '' ) . replace ( / < s u p > / gm, '^' ) ;
164
+ problem . desc = he . decode ( cheerio . load ( content ) . root ( ) . text ( ) ) ;
165
+
165
166
problem . templates = JSON . parse ( q . codeDefinition ) ;
166
167
problem . testcase = q . sampleTestCase ;
167
168
problem . testable = q . enableRunCode ;
You can’t perform that action at this time.
0 commit comments