diff --git a/.changeset/core-start-scope-with-attrs.md b/.changeset/core-start-scope-with-attrs.md new file mode 100644 index 0000000..a127ef9 --- /dev/null +++ b/.changeset/core-start-scope-with-attrs.md @@ -0,0 +1,11 @@ +--- +'@kindly-note/core': minor +--- + +Add the optional `startScopeWithAttrs(scope, attrs)` method to the `Emitter` contract (spec §13.3a, decision (a)). + +This is the backward-compatible enabler for attribute-bearing semantic HTML (``, `

`, ``) in the new `@kindly-note/emitters-markdown` package. The method is **optional**: existing emitters (`@kindly-note/emitters-html`, the internal recording emitter) do not implement it and are unaffected. + +**Engine plumbing:** a `Mode` (and the compiled `CompiledMode`) may now carry a static `attrs: Readonly>` payload. When a mode with `attrs` opens its scope, the matcher calls `startScopeWithAttrs` if the emitter implements it, otherwise it falls back to `startScope(scope)`. Modes without `attrs` always take the plain `startScope` path, so every shipped highlighting language behaves exactly as before. + +No breaking changes: all 71 pre-existing `core` tests pass unchanged; 3 new tests cover the attrs routing + the backward-compatible fallback. diff --git a/.changeset/emitters-markdown-initial.md b/.changeset/emitters-markdown-initial.md new file mode 100644 index 0000000..a7ee1b1 --- /dev/null +++ b/.changeset/emitters-markdown-initial.md @@ -0,0 +1,19 @@ +--- +'@kindly-note/emitters-markdown': minor +--- + +Initial release of `@kindly-note/emitters-markdown` — a semantic-HTML emitter for the `@kindly-note/lang-markdown` token stream, with **security-first defaults** (spec §1.5 / §13). + +It consumes the highlight-style CommonMark token stream and reconstructs semantic HTML: `

`–`

`, `

`, ``, ``, ``, `

` (with sub-language code-fence highlighting delegated to `@kindly-note/emitters-html`), ``, `