Skip to content

Commit b62bc83

Browse files
committed
Working markdown
1 parent 12e7dc7 commit b62bc83

File tree

16 files changed

+207
-38
lines changed

16 files changed

+207
-38
lines changed

extension/marked.min.js

Lines changed: 161 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extension/popup.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
body {
2+
font-family: Arial, sans-serif;
3+
padding: 10px;
4+
width: 300px;
5+
}
6+
7+
h3 {
8+
margin-top: 0;
9+
}
10+
11+
#getHelp {
12+
padding: 10px;
13+
background: #4CAF50;
14+
color: white;
15+
border: none;
16+
width: 100%;
17+
border-radius: 5px;
18+
cursor: pointer;
19+
margin-bottom: 10px;
20+
}
21+
22+
#output {
23+
white-space: pre-wrap;
24+
}
25+
26+
ul {
27+
padding-left: 20px;
28+
}
29+
30+
li {
31+
margin-bottom: 5px;
32+
}

extension/popup.html

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,19 @@
11
<!DOCTYPE html>
22
<html>
3+
34
<head>
45
<title>LeetCode Helper</title>
5-
<style>
6-
body {
7-
font-family: Arial, sans-serif;
8-
padding: 10px;
9-
width: 300px;
10-
}
11-
12-
h3 {
13-
margin-top: 0;
14-
}
15-
16-
#getHelp {
17-
padding: 10px;
18-
background: #4CAF50;
19-
color: white;
20-
border: none;
21-
width: 100%;
22-
border-radius: 5px;
23-
cursor: pointer;
24-
margin-bottom: 10px;
25-
}
26-
27-
ul {
28-
padding-left: 20px;
29-
}
30-
31-
li {
32-
margin-bottom: 5px;
33-
}
34-
</style>
6+
<link rel="stylesheet" href="popup.css">
7+
<script src="marked.min.js"></script><!--Markdown display package-->
358
</head>
9+
3610
<body>
3711
<h3>Need Help with LeetCode?</h3>
3812
<button id="getHelp">Get Step-by-Step Help</button>
3913

40-
<ul id="output"></ul> <!-- This is where the guided steps will appear -->
14+
<div id="output"></div><!-- This is where the guided steps will appear -->
4115

4216
<script src="popup.js"></script>
4317
</body>
44-
</html>
18+
19+
</html>

extension/popup.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ document.getElementById("getHelp").addEventListener("click", async () => {
2424
output.innerHTML = "";
2525

2626
if (data.steps && Array.isArray(data.steps)) {
27-
data.steps.forEach((step, index) => {
28-
const li = document.createElement("li");
29-
li.textContent = step;
30-
output.appendChild(li);
27+
data.steps.forEach((step) => {
28+
const div = document.createElement("div");
29+
div.innerHTML = marked.parse(step); // Using Marked package
30+
output.appendChild(div);
3131
});
3232
} else {
3333
output.innerHTML = "<p>No steps found.</p>";
3434
}
35+
3536
});
3637
});
9 Bytes
Binary file not shown.
9 Bytes
Binary file not shown.
9 Bytes
Binary file not shown.
9 Bytes
Binary file not shown.
9 Bytes
Binary file not shown.
9 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)