@rhseung/ps-cli 1.11.0 → 1.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  useFetchProblem
4
- } from "./chunk-Z4O2T5WH.js";
4
+ } from "./chunk-ERJEYECY.js";
5
5
  import {
6
6
  Command,
7
7
  CommandBuilder,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getProblem,
4
4
  scrapeProblem
5
- } from "./chunk-S7IL7OXF.js";
5
+ } from "./chunk-U6KQM2P4.js";
6
6
  import {
7
7
  findProjectRoot,
8
8
  getAutoOpenEditor,
@@ -5,7 +5,7 @@ import {
5
5
  getUserTagRatings,
6
6
  getUserTop100,
7
7
  scrapeUserStats
8
- } from "./chunk-S7IL7OXF.js";
8
+ } from "./chunk-U6KQM2P4.js";
9
9
  import {
10
10
  findProjectRoot,
11
11
  getArchiveDir,
@@ -295,6 +295,11 @@ ${preContent}
295
295
  });
296
296
  return result.trim();
297
297
  }
298
+ function convertLatexToMarkdown(text) {
299
+ return text.replace(/\\\[([\s\S]*?)\\\]/g, (match, latexCode) => {
300
+ return `$${latexCode}$`;
301
+ });
302
+ }
298
303
  async function scrapeProblem(problemId) {
299
304
  const url = `${BOJ_BASE_URL}/problem/${problemId}`;
300
305
  const html = await fetchWithRetry(url, `\uBB38\uC81C ${problemId}`);
@@ -307,10 +312,12 @@ async function scrapeProblem(problemId) {
307
312
  if (!description) {
308
313
  description = descriptionEl.text().trim();
309
314
  }
315
+ description = convertLatexToMarkdown(description);
310
316
  } else {
311
317
  const altDesc = $('[id*="description"]').first();
312
318
  if (altDesc.length > 0) {
313
319
  description = altDesc.text().trim();
320
+ description = convertLatexToMarkdown(description);
314
321
  }
315
322
  }
316
323
  const inputEl = $("#problem_input");
@@ -320,10 +327,12 @@ async function scrapeProblem(problemId) {
320
327
  if (!inputFormat) {
321
328
  inputFormat = inputEl.text().trim();
322
329
  }
330
+ inputFormat = convertLatexToMarkdown(inputFormat);
323
331
  } else {
324
332
  const altInput = $('[id*="input"]').first();
325
333
  if (altInput.length > 0) {
326
334
  inputFormat = altInput.text().trim();
335
+ inputFormat = convertLatexToMarkdown(inputFormat);
327
336
  }
328
337
  }
329
338
  const outputEl = $("#problem_output");
@@ -333,10 +342,12 @@ async function scrapeProblem(problemId) {
333
342
  if (!outputFormat) {
334
343
  outputFormat = outputEl.text().trim();
335
344
  }
345
+ outputFormat = convertLatexToMarkdown(outputFormat);
336
346
  } else {
337
347
  const altOutput = $('[id*="output"]').first();
338
348
  if (altOutput.length > 0) {
339
349
  outputFormat = altOutput.text().trim();
350
+ outputFormat = convertLatexToMarkdown(outputFormat);
340
351
  }
341
352
  }
342
353
  const problemInfo = {};
@@ -3,9 +3,9 @@ import {
3
3
  FetchCommand,
4
4
  FetchView,
5
5
  fetch_default
6
- } from "../chunk-CCTXJBQK.js";
7
- import "../chunk-Z4O2T5WH.js";
8
- import "../chunk-S7IL7OXF.js";
6
+ } from "../chunk-CGL3LQEB.js";
7
+ import "../chunk-ERJEYECY.js";
8
+ import "../chunk-U6KQM2P4.js";
9
9
  import "../chunk-AHE4QHJD.js";
10
10
  export {
11
11
  FetchCommand,
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  TestView
7
7
  } from "../chunk-COPOWZM5.js";
8
- import "../chunk-NQ267PM5.js";
8
+ import "../chunk-G272SKVM.js";
9
9
  import "../chunk-MZUR7SER.js";
10
10
  import {
11
11
  ArchiveView
@@ -14,13 +14,13 @@ import "../chunk-LCHSAHUP.js";
14
14
  import "../chunk-XNZBOLC2.js";
15
15
  import {
16
16
  FetchView
17
- } from "../chunk-CCTXJBQK.js";
18
- import "../chunk-Z4O2T5WH.js";
17
+ } from "../chunk-CGL3LQEB.js";
18
+ import "../chunk-ERJEYECY.js";
19
19
  import {
20
20
  fetchWithRetry,
21
21
  getProblem,
22
22
  searchProblems
23
- } from "../chunk-S7IL7OXF.js";
23
+ } from "../chunk-U6KQM2P4.js";
24
24
  import "../chunk-QT2FQELR.js";
25
25
  import {
26
26
  OpenView
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  useUserStats
4
- } from "../chunk-NQ267PM5.js";
5
- import "../chunk-S7IL7OXF.js";
4
+ } from "../chunk-G272SKVM.js";
5
+ import "../chunk-U6KQM2P4.js";
6
6
  import {
7
7
  Command,
8
8
  CommandBuilder,
@@ -4,12 +4,12 @@ import {
4
4
  TestView,
5
5
  test_default
6
6
  } from "../chunk-COPOWZM5.js";
7
- import "../chunk-NQ267PM5.js";
7
+ import "../chunk-G272SKVM.js";
8
8
  import "../chunk-MZUR7SER.js";
9
9
  import "../chunk-LCHSAHUP.js";
10
10
  import "../chunk-XNZBOLC2.js";
11
- import "../chunk-Z4O2T5WH.js";
12
- import "../chunk-S7IL7OXF.js";
11
+ import "../chunk-ERJEYECY.js";
12
+ import "../chunk-U6KQM2P4.js";
13
13
  import "../chunk-QT2FQELR.js";
14
14
  import "../chunk-3LR2NGRC.js";
15
15
  import "../chunk-QGMWUOJ3.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhseung/ps-cli",
3
- "version": "1.11.0",
3
+ "version": "1.11.1",
4
4
  "description": "백준(BOJ) 문제 해결을 위한 통합 CLI 도구",
5
5
  "type": "module",
6
6
  "bin": {