Skip to content

Commit

Permalink
Merge pull request #151 from QasimWani/dev
Browse files Browse the repository at this point in the history
merging problem hyperlink
  • Loading branch information
QasimWani authored Dec 17, 2021
2 parents d9a0efc + 587e477 commit 37483bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/leetcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,10 @@ function getProblemNameSlug(){

/* Parser function for the question and tags */
function parseQuestion() {
var questionUrl = window.location.href
if(questionUrl.endsWith('/submissions/')){
questionUrl = questionUrl.substring(0, questionUrl.lastIndexOf("/submissions/")+1)
}
const questionElem = document.getElementsByClassName(
'content__u3I1 question-content__JfgR',
);
Expand Down Expand Up @@ -410,7 +414,7 @@ function parseQuestion() {
difficulty = 'Hard';
}
// Final formatting of the contents of the README for each problem
const markdown = `<h2>${qtitle}</h2><h3>${difficulty}</h3><hr>${qbody}`;
const markdown = `<h2><a href="${questionUrl}">${qtitle}</a></h2><h3>${difficulty}</h3><hr>${qbody}`;
return markdown;
} else if(checkElem(questionDescriptionElem)){

Expand Down

0 comments on commit 37483bc

Please sign in to comment.