File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -131,8 +131,8 @@ plugin.getProblem = function(problem, cb) {
131131
132132 var pageData ;
133133 var r = / ( v a r p a g e D a t a [ ^ ; ] + ; ) / m;
134- var result = body . match ( r ) ;
135- if ( ! result ) {
134+ var re = body . match ( r ) ;
135+ if ( ! re ) {
136136 var user = session . getUser ( ) ;
137137 if ( problem . locked && user . paid ) {
138138 e = session . errors . EXPIRED ;
@@ -142,12 +142,16 @@ plugin.getProblem = function(problem, cb) {
142142 return cb ( e ) ;
143143 }
144144
145- eval ( result [ 1 ] ) ;
145+ eval ( re [ 1 ] ) ;
146146 problem . templates = pageData . codeDefinition ;
147147 problem . testcase = pageData . sampleTestCase ;
148148 problem . testable = pageData . enableRunCode ;
149149 problem . templateMeta = eval ( pageData . metaData ) ;
150150
151+ r = / h t t p s : \/ \/ d i s c u s s .l e e t c o d e .c o m \/ c a t e g o r y \/ ( \d + ) / ;
152+ re = body . match ( r ) ;
153+ if ( re ) problem . discuss = re [ 1 ] ;
154+
151155 return cb ( null , problem ) ;
152156 } ) ;
153157} ;
You can’t perform that action at this time.
0 commit comments