atcoder-workspace 1.1.0 → 1.1.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.
@@ -91,7 +91,7 @@ function convertLineToMath(line) {
91
91
  continue;
92
92
  }
93
93
  // 2. Match subscript pattern: e.g. A_i, query_1
94
- const subMatch = remaining.match(/^([a-zA-Z]+)_([a-zA-Z0-9]+)/);
94
+ const subMatch = remaining.match(/^([a-zA-Z]+)_([0-9]+|[a-zA-Z])/);
95
95
  if (subMatch) {
96
96
  flushBuffer();
97
97
  const base = subMatch[1];
package/dist/cli.js CHANGED
@@ -70,7 +70,7 @@ const program = new commander_1.Command();
70
70
  program
71
71
  .name('atc')
72
72
  .description('AtCoder Workspace')
73
- .version('1.1.0-beta.3');
73
+ .version('1.1.1');
74
74
  function handleAction(fn) {
75
75
  return async (...args) => {
76
76
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atcoder-workspace",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "AtCoder Workspace CLI (Local-first)",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {
@@ -190,4 +190,21 @@ Q
190
190
  expect(details.problemStatementMd).toContain('\\end{array}');
191
191
  expect(details.problemStatementMd).not.toContain('\\text\\text');
192
192
  });
193
+
194
+ it('should format pre blocks with adjacent subscripted variables like s_1s_2s_3 correctly', () => {
195
+ const htmlWithPreAdjacent = `
196
+ <div id="task-statement">
197
+ <span class="lang-en">
198
+ <h3>Input</h3>
199
+ <pre>
200
+ s_1s_2s_3
201
+ </pre>
202
+ </span>
203
+ </div>
204
+ `;
205
+ // Add <var> tag to trigger math conversion
206
+ const htmlWithPreVar = htmlWithPreAdjacent.replace('s_1s_2s_3', '<var>s_1s_2s_3</var>');
207
+ const details = parseProblemPage(htmlWithPreVar);
208
+ expect(details.problemStatementMd).toContain('\\text{s}_1\\text{s}_2\\text{s}_3');
209
+ });
193
210
  });
@@ -77,7 +77,7 @@ function convertLineToMath(line: string): string {
77
77
  }
78
78
 
79
79
  // 2. Match subscript pattern: e.g. A_i, query_1
80
- const subMatch = remaining.match(/^([a-zA-Z]+)_([a-zA-Z0-9]+)/);
80
+ const subMatch = remaining.match(/^([a-zA-Z]+)_([0-9]+|[a-zA-Z])/);
81
81
  if (subMatch) {
82
82
  flushBuffer();
83
83
  const base = subMatch[1];
package/src/cli.ts CHANGED
@@ -37,7 +37,7 @@ const program = new Command();
37
37
  program
38
38
  .name('atc')
39
39
  .description('AtCoder Workspace')
40
- .version('1.1.0');
40
+ .version('1.1.1');
41
41
 
42
42
  function handleAction(fn: (...args: any[]) => Promise<void>) {
43
43
  return async (...args: any[]) => {