svelte-streamdown 3.1.1 → 3.1.2
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.
|
@@ -257,4 +257,8 @@
|
|
|
257
257
|
{citationWithSources.length > 1 ? ` +${citationWithSources.length - 1}` : ''}
|
|
258
258
|
</Slot>
|
|
259
259
|
</button>
|
|
260
|
+
{:else}
|
|
261
|
+
<!-- No key matched a `sources` entry: render the literal citation text so it
|
|
262
|
+
isn't silently dropped (e.g. `[123]`, `[ref] [ref2]`). -->
|
|
263
|
+
{token.raw ?? `[${token.keys.join(', ')}]`}
|
|
260
264
|
{/if}
|
|
@@ -179,22 +179,31 @@ export const markedList = {
|
|
|
179
179
|
}
|
|
180
180
|
if (!endEarly) {
|
|
181
181
|
const { nextBullet, hr, fences, heading, html } = LIST_BOUNDARY_TABLE[Math.min(3, indent - 1)];
|
|
182
|
+
let sawBlankLine = false;
|
|
182
183
|
// Check if following lines should be included in List Item
|
|
183
184
|
while (src) {
|
|
184
185
|
const rawLine = src.split('\n', 1)[0];
|
|
185
186
|
const nextLineWithoutTabs = rawLine.replace(/\t/g, ' ');
|
|
187
|
+
const isBlankLine = !nextLineWithoutTabs.trim();
|
|
188
|
+
const isIndented = nextLineWithoutTabs.search(/[^ ]/) >= indent;
|
|
186
189
|
if (fences.test(nextLineWithoutTabs) ||
|
|
187
190
|
heading.test(nextLineWithoutTabs) ||
|
|
188
191
|
html.test(nextLineWithoutTabs) ||
|
|
189
192
|
nextBullet.test(nextLineWithoutTabs) ||
|
|
190
193
|
hr.test(nextLineWithoutTabs))
|
|
191
194
|
break;
|
|
192
|
-
|
|
195
|
+
// A blank line followed by a dedented non-bullet line ends the item:
|
|
196
|
+
// that line starts a new top-level block (a bullet after a blank line
|
|
197
|
+
// is a loose-list continuation and was already caught by nextBullet).
|
|
198
|
+
if (sawBlankLine && !isBlankLine && !isIndented)
|
|
199
|
+
break;
|
|
200
|
+
if (isIndented || isBlankLine) {
|
|
193
201
|
itemContents += '\n' + nextLineWithoutTabs.slice(indent);
|
|
194
202
|
}
|
|
195
203
|
else {
|
|
196
204
|
itemContents += '\n' + nextLineWithoutTabs;
|
|
197
205
|
}
|
|
206
|
+
sawBlankLine = isBlankLine;
|
|
198
207
|
raw += rawLine + '\n';
|
|
199
208
|
src = src.substring(rawLine.length + 1);
|
|
200
209
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-streamdown",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"packageManager": "pnpm@10.32.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"clsx": "^2.1.1",
|
|
100
100
|
"katex": "^0.16.22",
|
|
101
101
|
"marked": "^16.2.1",
|
|
102
|
-
"mermaid": "^11.
|
|
102
|
+
"mermaid": "^11.15.0",
|
|
103
103
|
"shiki": "^3.13.0",
|
|
104
104
|
"tailwind-merge": "^3.3.1"
|
|
105
105
|
}
|