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-
|
|
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
package/package.json
CHANGED
|
@@ -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-
|
|
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