feat: the assistant's answers in Markdown; thinking shows «Думаю…», then «Думал N с», opening smoothly by its arrow

This commit is contained in:
redtea committed 2026-10-16 09:33:23 +03:00
1 parent 4b7220fffb
commit 4da1cc4200
4 files changed
+103 -12

No files matched your search

+13
View File
@@ -62,3 +62,16 @@ test('parseActions: run, read, ls and write blocks with or without a machine', (
// A block still being written is not an action yet.
assert.strictEqual(U.parseActions('```run\nls').length, 0);
});
test('md: the common marks, everything else escaped', () => {
assert.strictEqual(U.md('**жирный** и *курсив*, `ls -la <x>`'),
'<p><b>жирный</b> и <i>курсив</i>, <code>ls -la &lt;x&gt;</code></p>');
assert.strictEqual(U.md('# Итог\n- раз\n- два\n\n1. первое\n2. второе'),
'<h4>Итог</h4><ul><li>раз</li><li>два</li></ul><ol><li>первое</li><li>второе</li></ol>');
assert.strictEqual(U.md('[док](https://ex.com/a?b=1&c=2) и [плохо](javascript:alert(1))'),
'<p><a href="https://ex.com/a?b=1&amp;c=2" target="_blank" rel="noopener">док</a> и плохо</p>');
assert.strictEqual(U.md('> цитата\n\nстрока 1\nстрока 2'), '<blockquote>цитата</blockquote><p>строка 1<br>строка 2</p>');
assert.strictEqual(U.md('<script>x</script>'), '<p>&lt;script&gt;x&lt;/script&gt;</p>');
// Inside code nothing is marked up.
assert.strictEqual(U.md('`**a**`'), '<p><code>**a**</code></p>');
});