@mdsvex/render 1.0.0-next.0 → 1.0.0-next.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,299 @@
1
1
  ## 1.0.0-next.0
2
2
 
3
+ ## 1.0.0-next.1
4
+
5
+ ### Minor Changes
6
+
7
+ - [#866](https://github.com/pngwn/MDsveX/pull/866) [`60da683`](https://github.com/pngwn/MDsveX/commit/60da68313df11747bdd6235dffc325c30af60cb2) Thanks [@pngwn](https://github.com/pngwn)! - Import statements at the top of a document are kept. They go into the document's instance `<script>`, or into a new `<script>` when there is none.
8
+
9
+ ```md
10
+ import Chart from './Chart.svelte'
11
+
12
+ <Chart />
13
+ ```
14
+
15
+ - [#873](https://github.com/pngwn/MDsveX/pull/873) [`69b6c62`](https://github.com/pngwn/MDsveX/commit/69b6c624256f1e8fb1cf8e5f348980a043f2c1db) Thanks [@pngwn](https://github.com/pngwn)! - `component_mode: 'all'` now replaces HTML you type as well as elements written in markdown:
16
+
17
+ ```ts
18
+ mdsvex({ components: '#lib/markdown.ts', component_mode: 'all' });
19
+ ```
20
+
21
+ A lowercase element such as `<h2>` or `<img>` uses the same replacement as its markdown form, and a custom tag such as `<warning>` uses a `warning` export, so a components module can provide tags that work in every document without imports. Attributes pass through as props exactly as written, including `{expr}`, `{shorthand}`, `{...spread}` and `{@attach}`. A typed `h1` to `h6` gets `level`, and an `ol` without `start` gets `start={1}`. Children arrive as `children`, and void elements get none.
22
+
23
+ `<svelte:*>` tags and capitalised components are never replaced, so `<svelte:element this="img">` renders a plain element. An element with a directive (`bind:`, `on:`, `use:`, `class:`, `style:`, `transition:`, `in:`, `out:`, `animate:` or `let:`) stays an element, because a component can't take one. The compiler warns about it, and `compile()` returns the warning in `warnings`.
24
+
25
+ - [#870](https://github.com/pngwn/MDsveX/pull/870) [`fa297f9`](https://github.com/pngwn/MDsveX/commit/fa297f9b3fda7cc11c3f4274ba0b0cc27acedf9a) Thanks [@pngwn](https://github.com/pngwn)! - Elements written in markdown can be replaced with your own Svelte components. Point the `components` option at one or more modules, and each export named after an element replaces that element:
26
+
27
+ ```ts
28
+ // vite.config.ts
29
+ mdsvex({ components: '#lib/markdown.ts' });
30
+ ```
31
+
32
+ ```ts
33
+ // src/lib/markdown.ts
34
+ export { default as h2 } from './Heading.svelte';
35
+ export { default as img } from './Image.svelte';
36
+ ```
37
+
38
+ Specifiers resolve the way an import from the Vite root would, so aliases, package exports and `#lib/...` subpath imports work, as does `new URL('./markdown.ts', import.meta.url)`. A `.svelte` module works too, and its `<script module>` exports are the replacements.
39
+
40
+ Only elements produced by markdown syntax or by parse plugins are replaced. HTML you type yourself stays as it is. A replacement gets the element's attributes as props, plus `children` unless the element is void (`img`, `hr`, `br`). Some elements also get extra props:
41
+ - `h1` to `h6` get `level`.
42
+ - `pre` gets `lang`, `meta` and the raw `code`.
43
+ - `ol` gets `start`.
44
+ - `li` gets `checked`, when a plugin sets it.
45
+ - `th` and `td` get `align`.
46
+
47
+ Each document imports only the components it uses. When a module's export names change, the dev server recompiles the documents that use it.
48
+
49
+ - [#874](https://github.com/pngwn/MDsveX/pull/874) [`311902d`](https://github.com/pngwn/MDsveX/commit/311902de7c606430e3899440d37def14f5190b6c) Thanks [@pngwn](https://github.com/pngwn)! - Generic directives now render as your own Svelte components. A components module declares its directives with a `directives` namespace export. Directives are a separate namespace from element replacements, so a `table` export never serves `:::table`:
50
+
51
+ ```ts
52
+ // src/lib/markdown.ts, passed as mdsvex({ components: '#lib/markdown.ts' })
53
+ export { default as img } from './Image.svelte';
54
+ export * as directives from './directives.ts';
55
+ ```
56
+
57
+ ```ts
58
+ // src/lib/directives.ts
59
+ export { default as Callout } from './Callout.svelte';
60
+ export { default as abbr } from './Abbr.svelte';
61
+ ```
62
+
63
+ Here is what each directive passes to its component:
64
+ - **Args** arrive as string props.
65
+ - **Leaf and container text** in the brackets arrives as a `label` snippet.
66
+ - **Inline directive text** arrives as `children`.
67
+ - **A container's body** arrives as `children`.
68
+
69
+ So `:::Callout[Heads up](kind=warn)` passes `kind="warn"`, a `label` snippet and the body as `children`.
70
+
71
+ A directive with no component is passed to parse plugins' `directive_inline`, `directive_leaf` and `directive_container` handlers. If none of them replaces it, the compile fails with a `DirectiveError` that names the directive and its line. Before this change, an unhandled directive rendered as its children and a leaf directive disappeared. A directive with a component never reaches a plugin's directive handlers.
72
+
73
+ - [#899](https://github.com/pngwn/MDsveX/pull/899) [`1219ceb`](https://github.com/pngwn/MDsveX/commit/1219ceb0c6805ac8b169dadb13694f354d96a619) Thanks [@pngwn](https://github.com/pngwn)! - Tables can have header columns and merged cells. A `||` in the delimiter row, matched by an empty `||` cell in the header row, turns the columns on its narrower side into row headers, and two `||` give headers on both sides. A cell holding only `>` merges into the cell to its left, and a cell holding only `^` merges into the cell above. Merged cells must form rectangles, and a marker that can't merge stays text.
74
+
75
+ ```md
76
+ | maybe || title |> |
77
+ |-------||-------|---|
78
+ | hello || text | b |
79
+ |^ || more | c |
80
+ ```
81
+
82
+ - [#872](https://github.com/pngwn/MDsveX/pull/872) [`045aca9`](https://github.com/pngwn/MDsveX/commit/045aca94077183b8b58bb59c45813f0aa4f33cde) Thanks [@pngwn](https://github.com/pngwn)! - Frontmatter becomes the document's metadata. The compiled component exports it from its `<script module>` as `metadata`, and `compile()` returns it as `metadata`. When the document already has a module script, the export goes into that script.
83
+
84
+ ```md
85
+ ---
86
+ title: Hello
87
+ tags: [svelte, markdown]
88
+ ---
89
+ ```
90
+
91
+ ```svelte
92
+ <script module>
93
+ export const metadata = {"title":"Hello","tags":["svelte","markdown"]};
94
+ </script>
95
+ ```
96
+
97
+ mdsvex parses the YAML that frontmatter commonly holds: strings, numbers, booleans, null, nested maps, block and flow sequences, `|` and `>` blocks and comments. Dates stay strings. Anything else, such as anchors or tags, fails with an error naming the line. For full YAML, pass a parser:
98
+
99
+ ```js
100
+ import { parse } from 'yaml';
101
+
102
+ mdsvex({ frontmatter: { parse } });
103
+ ```
104
+
105
+ - [#895](https://github.com/pngwn/MDsveX/pull/895) [`57ecb44`](https://github.com/pngwn/MDsveX/commit/57ecb446b292a3406dcf62550986ed15e1aa2b80) Thanks [@pngwn](https://github.com/pngwn)! - Code blocks can hold live Svelte expressions. An `[!eval]` comment makes every top-level `{...}` group in its range live, and everything else stays text:
106
+
107
+ ````md
108
+ ```sh
109
+ {install_command} @pkg/my-pkg # [!eval]
110
+ ```
111
+
112
+ ```js
113
+ function my_func() {
114
+ console.log({ a: { some_val } }); // [!eval ="{some_val}"]
115
+ }
116
+ ```
117
+ ````
118
+
119
+ `[!eval]` takes every twinkleplop argument form: bare for its own line, `+N`, `:N..M`, `="{x}"` with an optional `:*`, anchors and pairs. It is on by default and part of `default_annotations`. Values come from the document's script and `metadata` and render as text, so use `{@html}` for markup. A group that doesn't close on its line, or a block tag such as `{#if}`, fails the build with its line and column.
120
+
121
+ The `eval` fence flag means `[!eval]` on every line, on any fence, including ` ```eval ` for a fence with no language. It suits commands and config rather than brace-heavy code. A custom highlighter doesn't support it yet and warns.
122
+
123
+ A replaced `pre` gets `code` as a template literal with the live values in it, such as ``code={`${install_command} @pkg/my-pkg`}``, so a copy button copies what the reader sees. Each live expression gets its own source mapping.
124
+
125
+ - [#866](https://github.com/pngwn/MDsveX/pull/866) [`60da683`](https://github.com/pngwn/MDsveX/commit/60da68313df11747bdd6235dffc325c30af60cb2) Thanks [@pngwn](https://github.com/pngwn)! - A top level `<script>` with a `src` attribute, as in pasted tweet or Instagram embeds, renders as `<svelte:element this={"script"}>`. Svelte treats every top level `<script>` as the component script, so two embeds used to fail to compile.
126
+
127
+ - [#891](https://github.com/pngwn/MDsveX/pull/891) [`8ede5e2`](https://github.com/pngwn/MDsveX/commit/8ede5e2b409511978562fcec3271e7f5182789db) Thanks [@pngwn](https://github.com/pngwn)! - Fenced code and `` `#!lang code` `` spans are highlighted with [twinkleplop](https://twinkleplop.pngwn.at) by default in the Vite plugin. Every twinkleplop language loads the first time a document has code, along with the common aliases (`js`, `ts`, `sh`, `yml`, `md`, `py` and others). Lookup tries the exact name, then the lowercased one. A language mdsvex doesn't know renders as plain twinkleplop markup, with one warning per file. mdsvex adds no CSS, so import a theme yourself:
128
+
129
+ ```js
130
+ import '@twinkleplop/theme-github';
131
+ ```
132
+
133
+ ```ts
134
+ mdsvex({
135
+ highlight: {
136
+ languages: { dockerfile: 'bash' },
137
+ line_numbers: false,
138
+ twoslash: { svelte: true },
139
+ },
140
+ });
141
+ ```
142
+
143
+ Highlighted output is markup, not `{@html}`. Twinkleplop escapes `{` and `}` as it renders, so code never reaches Svelte as an expression. Fences accept the Shiki, VitePress and rehype-pretty-code meta conventions: `{1,3-4}`, `/word/`, `:line-numbers`, `showLineNumbers`, `[title]`, `title="..."` and `caption="..."`. A title or caption wraps the block in a `<figure>`. Twinkleplop's annotations (`// [!hl]`, `[!focus]`, `[!add]` and the rest) are on by default, and `default_annotations` is exported for extending the list. `twoslash: true` needs `@twinkleplop/twoslash`, and `{ svelte: true }` also needs `@twinkleplop/twoslash-svelte`.
144
+
145
+ `compile()` takes a `highlight` option too. It stays synchronous and doesn't highlight by default. Build a config with `mdsvex/highlight`, which loads the languages in its only async function:
146
+
147
+ ```js
148
+ import { compile } from 'mdsvex/compile';
149
+ import { create_highlight, load_default_languages } from 'mdsvex/highlight';
150
+
151
+ const highlight = create_highlight({
152
+ languages: await load_default_languages(),
153
+ });
154
+ compile(source, { highlight, filename: 'post.svx' });
155
+ ```
156
+
157
+ `highlight` also takes a synchronous function, `(code, { lang, meta, inline, filename }) => html`, or `false`. A function returns ordinary HTML and mdsvex escapes every brace in it. Returning `null` renders that code plain.
158
+
159
+ A replaced `pre` now gets the whole `<pre>` element as `children`, because Svelte only keeps whitespace inside a `<pre>` it can see. It also gets `lang`, `meta`, `code` (the text a reader sees, without annotation markers), `title`, `caption`, and a prop for each meta part no convention claims, such as `playground` or `height=300`:
160
+
161
+ ```svelte
162
+ <script>
163
+ let { code, title, children } = $props();
164
+ </script>
165
+
166
+ <div class="code">
167
+ {#if title}<span>{title}</span>{/if}
168
+ <button onclick={() => navigator.clipboard.writeText(code)}>copy</button>
169
+ {@render children()}
170
+ </div>
171
+ ```
172
+
173
+ A highlighted code span goes through the `code` replacement with a `lang` prop. The `language-` class now carries only the language, never the rest of the info string.
174
+
175
+ - [#876](https://github.com/pngwn/MDsveX/pull/876) [`1dceed1`](https://github.com/pngwn/MDsveX/commit/1dceed1b863e202066c943d7b3e463db7e8fdb05) Thanks [@pngwn](https://github.com/pngwn)! - Documents can be wrapped in templates, which were called layouts in mdsvex 0.x. A template is a Svelte component. It gets the frontmatter and any props passed to the document as props, and the document body as `children`:
176
+
177
+ ```ts
178
+ // vite.config.ts
179
+ mdsvex({
180
+ templates: {
181
+ default: '#lib/templates/Post.svelte',
182
+ docs: './src/lib/templates/Docs.svelte',
183
+ blog: new URL('./src/Blog.svelte', import.meta.url),
184
+ },
185
+ });
186
+ ```
187
+
188
+ ```svelte
189
+ <!-- src/lib/templates/Post.svelte -->
190
+ <script module>
191
+ export { default as h2 } from './Heading.svelte';
192
+ </script>
193
+
194
+ <script>
195
+ let { title, children } = $props();
196
+ </script>
197
+
198
+ <article>
199
+ <h1>{title}</h1>
200
+ {@render children()}
201
+ </article>
202
+ ```
203
+
204
+ Specifiers resolve the way an import from the Vite root would, as with `components`. Element-named exports from a template's `<script module>` replace those elements in the documents it wraps, and they take precedence over the `components` modules. To add replacements to a template you can't edit, pass `{ component, components }`, and the `components` module's exports are merged over the template's own.
205
+
206
+ mdsvex picks a document's template in this order:
207
+ 1. Frontmatter `template: false` means no template.
208
+ 2. Frontmatter `template: docs` picks that template. An unknown name is an error that lists the known names.
209
+ 3. `select_template(id, metadata)`, when given.
210
+ 4. The `default` template, when there is one.
211
+
212
+ You can also override the template on an import, with `import Post from './post.svx?template=false'` or `?template=docs`.
213
+
214
+ The document's `<script>`, `<script module>`, `<style>` and top level `<svelte:head>`, `<svelte:window>`, `<svelte:body>`, `<svelte:document>` and `<svelte:options>` stay outside the template. A frontmatter key named `children` is an error when the document has a template. A document that binds its own props with `let props = $props()` forwards `props` to the template. A document that destructures its props forwards nothing.
215
+
216
+ `compile()` takes the same options as plain data, with `templates` mapping names to `{ specifier, components }`, plus `default_template` and `select_template(metadata)`. It returns the name of the template it used as `template`. When a template's export names change, the dev server recompiles the documents that used it.
217
+
218
+ ### Patch Changes
219
+
220
+ - [#891](https://github.com/pngwn/MDsveX/pull/891) [`8ede5e2`](https://github.com/pngwn/MDsveX/commit/8ede5e2b409511978562fcec3271e7f5182789db) Thanks [@pngwn](https://github.com/pngwn)! - Braces in code spans, fenced code and fence info strings render as text, so Svelte no longer reads them as expressions.
221
+
222
+ ```md
223
+ Use `{ a: 1 }` here.
224
+ ```
225
+
226
+ - [#879](https://github.com/pngwn/MDsveX/pull/879) [`79bebc9`](https://github.com/pngwn/MDsveX/commit/79bebc937b5c51d7fb50d06ff09f83bf23d44a87) Thanks [@pngwn](https://github.com/pngwn)! - Leaf and container directive labels now take inline markdown, as inline directive text does. A directive component's `label` snippet renders it, so `:::Callout[Heads *up*]` passes `Heads <strong>up</strong>`. Links, images and autolinks stay literal, and nothing in a label reaches past its closing `]`, so `::x[*a](k=*)` keeps `*a` as text and its args intact.
227
+
228
+ In the parse tree the label is a `directive_label` node, the directive's first child, so a container's label stays apart from its body:
229
+
230
+ ```
231
+ directive_container name="Callout"
232
+ directive_label
233
+ text "Heads "
234
+ strong_emphasis
235
+ text "up"
236
+ paragraph
237
+ text "body"
238
+ ```
239
+
240
+ - [#862](https://github.com/pngwn/MDsveX/pull/862) [`31aa6e2`](https://github.com/pngwn/MDsveX/commit/31aa6e20390c6fa656845add1d19e0439dda48c7) Thanks [@pngwn](https://github.com/pngwn)! - Parsing, compiling, parse plugins and the vite plugin are faster for documents of every size. The largest gains are in compiles with parse plugins and in the vite plugin, where chaining the Svelte compiler's sourcemap no longer goes through a general purpose remapper.
241
+
242
+ - [#865](https://github.com/pngwn/MDsveX/pull/865) [`fd54579`](https://github.com/pngwn/MDsveX/commit/fd5457966ce23d1eb29a7935a550394adf4498e4) Thanks [@pngwn](https://github.com/pngwn)! - Parsing, incremental parsing, compiling with and without sourcemaps, parse plugins and the vite plugin are faster again for documents of every size, with the largest gains on small documents, sourcemapped compiles and Windows line endings.
243
+
244
+ - [#856](https://github.com/pngwn/MDsveX/pull/856) [`8bd14fe`](https://github.com/pngwn/MDsveX/commit/8bd14fe77aed1ff532757a06e934fa6238ecb2da) Thanks [@pngwn](https://github.com/pngwn)! - Rendering to HTML without a source map is a few percent faster.
245
+
246
+ - [#855](https://github.com/pngwn/MDsveX/pull/855) [`98a1b87`](https://github.com/pngwn/MDsveX/commit/98a1b87b1c45f192c93bf3b910d6ebc8284b94f4) Thanks [@pngwn](https://github.com/pngwn)! - Rendering markdown to HTML is much faster, up to about 2.9x, and building source maps for the rendered output is many times faster.
247
+
248
+ - [#848](https://github.com/pngwn/MDsveX/pull/848) [`f2ff5fe`](https://github.com/pngwn/MDsveX/commit/f2ff5fe144a9009a79e0aa7a6f08f1bed5a7696c) Thanks [@pngwn](https://github.com/pngwn)! - Sourcemaps for large documents build in linear time, so a 100KB file takes milliseconds instead of over a second in the vite plugin.
249
+
250
+ - [#865](https://github.com/pngwn/MDsveX/pull/865) [`fd54579`](https://github.com/pngwn/MDsveX/commit/fd5457966ce23d1eb29a7935a550394adf4498e4) Thanks [@pngwn](https://github.com/pngwn)! - Source mappings are now objects whose `sourceOffsets`, `generatedOffsets`, `lengths` and `data` are getters. Read those properties directly; spreading a mapping no longer copies them.
251
+
252
+ ```ts
253
+ const copy = { ...mapping, data: other }; // before: offsets copied, now: offsets missing
254
+ const copy = {
255
+ sourceOffsets: mapping.sourceOffsets,
256
+ generatedOffsets: mapping.generatedOffsets,
257
+ lengths: mapping.lengths,
258
+ data: other,
259
+ };
260
+ ```
261
+
262
+ - [#896](https://github.com/pngwn/MDsveX/pull/896) [`4c55f5e`](https://github.com/pngwn/MDsveX/commit/4c55f5eea023e687202fa97626b401f09bffd6f7) Thanks [@pngwn](https://github.com/pngwn)! - A replaced `pre` gets `title`, `caption` and meta props from the fence meta with `highlight: false` too, which is the `compile()` default, and when a highlighter returns `null` for a fence. A meta prop that collides with a built-in prop is dropped with the same warning in every mode.
263
+
264
+ ````md
265
+ ```ts title="math.ts" playground height=300
266
+ const a = 1;
267
+ ```
268
+ ````
269
+
270
+ gives `title={"math.ts"}`, `playground={true}` and `height={"300"}` whether or not the code is highlighted. A fence that isn't replaced still renders as a plain `<pre><code class="language-ts">` without highlighting, with no `<figure>` for its title or caption.
271
+
272
+ - [#884](https://github.com/pngwn/MDsveX/pull/884) [`e708e1d`](https://github.com/pngwn/MDsveX/commit/e708e1d4c66478efd8606fa2e1ff2fee40e0732a) Thanks [@pngwn](https://github.com/pngwn)! - A fenced code block inside a block quote renders without the quote markers at the start of each line.
273
+
274
+ - [#855](https://github.com/pngwn/MDsveX/pull/855) [`98a1b87`](https://github.com/pngwn/MDsveX/commit/98a1b87b1c45f192c93bf3b910d6ebc8284b94f4) Thanks [@pngwn](https://github.com/pngwn)! - The low-level render helpers exported with a leading underscore now collect source mappings into a `MapSink` instead of an array, and the `PendingMapping` type is no longer exported.
275
+
276
+ - [#871](https://github.com/pngwn/MDsveX/pull/871) [`2867d9b`](https://github.com/pngwn/MDsveX/commit/2867d9b0df02ae44f0475403ce62393bca4f64b9) Thanks [@pngwn](https://github.com/pngwn)! - mdsvex now ships type declarations, so TypeScript finds types for `compile`, `CompileOptions`, `mdsvex` and the other exports instead of reporting a missing declaration file. Types for `@mdsvex/render` also check under TypeScript 6.
277
+
278
+ - [#889](https://github.com/pngwn/MDsveX/pull/889) [`c56db79`](https://github.com/pngwn/MDsveX/commit/c56db798f4f43e437956bb3afb2919c09076cd6e) Thanks [@pngwn](https://github.com/pngwn)! - Character references like `&lt;`, `&copy;` and `&#123;` in text, link and image attributes render as written instead of being escaped a second time. A bare `&`, a backslash escaped `\&` and any `&` inside code are still escaped.
279
+
280
+ ```md
281
+ a &lt; b &copy;
282
+ ```
283
+
284
+ - [#875](https://github.com/pngwn/MDsveX/pull/875) [`2927382`](https://github.com/pngwn/MDsveX/commit/29273823dc39bf4ab9b422210ee8acd867c29bc9) Thanks [@pngwn](https://github.com/pngwn)! - Attribute values in raw html render as written, so an entity like `&amp;` is no longer escaped a second time.
285
+
286
+ ```md
287
+ <div title="a &amp; b">x</div>
288
+ ```
289
+
290
+ - [#873](https://github.com/pngwn/MDsveX/pull/873) [`69b6c62`](https://github.com/pngwn/MDsveX/commit/69b6c624256f1e8fb1cf8e5f348980a043f2c1db) Thanks [@pngwn](https://github.com/pngwn)! - Spread and attachment attributes on HTML you type, such as `<div {...rest} {@attach tooltip}>`, are no longer rendered as `...rest={...rest}`, which Svelte failed to compile.
291
+
292
+ - [#821](https://github.com/pngwn/MDsveX/pull/821) [`ed11417`](https://github.com/pngwn/MDsveX/commit/ed11417775290f85a0b14dda03d1c11d48bbd239) Thanks [@pngwn](https://github.com/pngwn)! - Files with Windows (`\r\n`) or old Mac (`\r`) line endings compile to the same HTML as their `\n` equivalents, and their sourcemaps point at the right lines and columns in the original file.
293
+
294
+ - Updated dependencies [[`cfee8d1`](https://github.com/pngwn/MDsveX/commit/cfee8d1a968ac78329e314650c51785968bf1dff), [`b249bf0`](https://github.com/pngwn/MDsveX/commit/b249bf0dbbfdef330e0e78739b7d44176f9c98b9), [`29b6dd1`](https://github.com/pngwn/MDsveX/commit/29b6dd127efc0d00dff650d320d4d003f6d2b1b6), [`7815ee9`](https://github.com/pngwn/MDsveX/commit/7815ee9d0993774f6f648d46d35ce3f900a6eed4), [`db0418d`](https://github.com/pngwn/MDsveX/commit/db0418d50bcd286a062cd0b6243a234167d11781), [`ebdb9fb`](https://github.com/pngwn/MDsveX/commit/ebdb9fb687933c69da0260eb50e8a4d2fae2bbca), [`79bebc9`](https://github.com/pngwn/MDsveX/commit/79bebc937b5c51d7fb50d06ff09f83bf23d44a87), [`1219ceb`](https://github.com/pngwn/MDsveX/commit/1219ceb0c6805ac8b169dadb13694f354d96a619), [`98a1b87`](https://github.com/pngwn/MDsveX/commit/98a1b87b1c45f192c93bf3b910d6ebc8284b94f4), [`31aa6e2`](https://github.com/pngwn/MDsveX/commit/31aa6e20390c6fa656845add1d19e0439dda48c7), [`fd54579`](https://github.com/pngwn/MDsveX/commit/fd5457966ce23d1eb29a7935a550394adf4498e4), [`e804671`](https://github.com/pngwn/MDsveX/commit/e804671afb412c81ce5cb38c40588257d34ab99d), [`e804671`](https://github.com/pngwn/MDsveX/commit/e804671afb412c81ce5cb38c40588257d34ab99d), [`2f981d8`](https://github.com/pngwn/MDsveX/commit/2f981d84b04a718dae82f79e6a9243868444f88c), [`cfee8d1`](https://github.com/pngwn/MDsveX/commit/cfee8d1a968ac78329e314650c51785968bf1dff), [`6f4a27d`](https://github.com/pngwn/MDsveX/commit/6f4a27da11241056ef4912618cefee521525a82a), [`585a698`](https://github.com/pngwn/MDsveX/commit/585a698f25fd0b6160e25bf0022e3cdabde65172), [`65c9784`](https://github.com/pngwn/MDsveX/commit/65c9784b51209c7706eebaada3e9908bda9d5fa4), [`31aa6e2`](https://github.com/pngwn/MDsveX/commit/31aa6e20390c6fa656845add1d19e0439dda48c7), [`585a698`](https://github.com/pngwn/MDsveX/commit/585a698f25fd0b6160e25bf0022e3cdabde65172), [`585a698`](https://github.com/pngwn/MDsveX/commit/585a698f25fd0b6160e25bf0022e3cdabde65172), [`98a1b87`](https://github.com/pngwn/MDsveX/commit/98a1b87b1c45f192c93bf3b910d6ebc8284b94f4), [`fd54579`](https://github.com/pngwn/MDsveX/commit/fd5457966ce23d1eb29a7935a550394adf4498e4), [`585a698`](https://github.com/pngwn/MDsveX/commit/585a698f25fd0b6160e25bf0022e3cdabde65172), [`585a698`](https://github.com/pngwn/MDsveX/commit/585a698f25fd0b6160e25bf0022e3cdabde65172), [`29b6dd1`](https://github.com/pngwn/MDsveX/commit/29b6dd127efc0d00dff650d320d4d003f6d2b1b6), [`31aa6e2`](https://github.com/pngwn/MDsveX/commit/31aa6e20390c6fa656845add1d19e0439dda48c7), [`9903c3a`](https://github.com/pngwn/MDsveX/commit/9903c3ad8d764085285486816736c4f3ea140a99), [`7e69d52`](https://github.com/pngwn/MDsveX/commit/7e69d52284e20892752041fb42726480d88cf31c), [`fd54579`](https://github.com/pngwn/MDsveX/commit/fd5457966ce23d1eb29a7935a550394adf4498e4), [`31aa6e2`](https://github.com/pngwn/MDsveX/commit/31aa6e20390c6fa656845add1d19e0439dda48c7), [`e804671`](https://github.com/pngwn/MDsveX/commit/e804671afb412c81ce5cb38c40588257d34ab99d), [`98a1b87`](https://github.com/pngwn/MDsveX/commit/98a1b87b1c45f192c93bf3b910d6ebc8284b94f4), [`f2e4911`](https://github.com/pngwn/MDsveX/commit/f2e4911db89f7c66f684c0da839deeb3bc46fa55), [`e804671`](https://github.com/pngwn/MDsveX/commit/e804671afb412c81ce5cb38c40588257d34ab99d), [`2f981d8`](https://github.com/pngwn/MDsveX/commit/2f981d84b04a718dae82f79e6a9243868444f88c), [`e804671`](https://github.com/pngwn/MDsveX/commit/e804671afb412c81ce5cb38c40588257d34ab99d), [`ed11417`](https://github.com/pngwn/MDsveX/commit/ed11417775290f85a0b14dda03d1c11d48bbd239), [`fd54579`](https://github.com/pngwn/MDsveX/commit/fd5457966ce23d1eb29a7935a550394adf4498e4), [`60da683`](https://github.com/pngwn/MDsveX/commit/60da68313df11747bdd6235dffc325c30af60cb2), [`430cf34`](https://github.com/pngwn/MDsveX/commit/430cf3493575c706b31b5e02b4c219f4b6ea0569), [`eefaff5`](https://github.com/pngwn/MDsveX/commit/eefaff563e6ce05026f92c03fce21b3ba4bd5e77), [`3f5bbbb`](https://github.com/pngwn/MDsveX/commit/3f5bbbb069ca12e16b3bb96afb60c41362161109), [`60da683`](https://github.com/pngwn/MDsveX/commit/60da68313df11747bdd6235dffc325c30af60cb2), [`65c9784`](https://github.com/pngwn/MDsveX/commit/65c9784b51209c7706eebaada3e9908bda9d5fa4), [`585a698`](https://github.com/pngwn/MDsveX/commit/585a698f25fd0b6160e25bf0022e3cdabde65172), [`585a698`](https://github.com/pngwn/MDsveX/commit/585a698f25fd0b6160e25bf0022e3cdabde65172), [`9903c3a`](https://github.com/pngwn/MDsveX/commit/9903c3ad8d764085285486816736c4f3ea140a99), [`2f981d8`](https://github.com/pngwn/MDsveX/commit/2f981d84b04a718dae82f79e6a9243868444f88c), [`cbc0029`](https://github.com/pngwn/MDsveX/commit/cbc00291119021655765fd4f4e05d9f4fb320727)]:
295
+ - @mdsvex/parse@1.0.0-next.1
296
+
3
297
  ### Major Changes
4
298
 
5
299
  - [#795](https://github.com/pngwn/MDsveX/pull/795) [`6ac3826`](https://github.com/pngwn/MDsveX/commit/6ac382615eb410230e8423d5ca4202005588869e) Thanks [@pngwn](https://github.com/pngwn)! - Add new PFM parser, renderers
package/dist/component.js CHANGED
@@ -2,16 +2,16 @@ class r {
2
2
  constructor() {
3
3
  this.blocks = [], this.buf = null, this.source = "", this.closed = /* @__PURE__ */ new Set();
4
4
  }
5
- update(t, c) {
6
- this.buf = t, this.source = c;
7
- let e = 0, i = !1, s = t._children_starts[0];
5
+ update(t, l) {
6
+ this.buf = t, this.source = l;
7
+ let e = 0, i = !1, s = t.first_child_at(0);
8
8
  for (; s !== 4294967295; ) {
9
- const o = t._kinds[s], l = t._next_siblings[s], h = l !== 4294967295 && t._parents[l] === 0;
9
+ const o = t.kind_at(s), c = t.next_at(s), h = c !== 4294967295 && t.parent_at(c) === 0;
10
10
  if (o !== 6) {
11
- const n = t._ends[s] !== 4294967295;
11
+ const n = t.end_at(s) !== 4294967295;
12
12
  e >= this.blocks.length ? (this.blocks.push({ idx: s, v: 0 }), i = !0) : this.closed.has(s) || (this.blocks[e].v++, i = !0), n && !this.closed.has(s) && this.closed.add(s), e++;
13
13
  }
14
- s = h ? l : 4294967295;
14
+ s = h ? c : 4294967295;
15
15
  }
16
16
  return i ? this.blocks = [...this.blocks] : this.blocks;
17
17
  }