---
mykey:
- my
- array
---
## md2sv
This document is valid _Markdown-in-Svelte_ or _Svelte-in-Markdown_, depending on the way you look
at it, since Svelte is basically HTML, and Markdown can hold arbitrary HTML which it does not
transform. It follows that "Markdown-to-Svelte" is actually a no-op. Why, then, is there a need for
a library?
### Features
#### Curly braces
Svelte's { and } are special, so, for the writer's convenience, they are escaped by _md2sv_.
#### 'Frontmatter'
Since the beginning of static website generators (Jekyll, Webgen, etc.), the blog post files were
actually in YAML format. The first YAML document (delimited by `---`) by convention is called the
'frontmatter'. `md2sv` parses this data and adds it to Svelte's (maybe pre-existing)
_module-context script_. This way, the defined key/value pairs become properties of the Svelte
component itself.
#### Raw text
_md2sv_ offers a [Markdown Directive](https://talk.commonmark.org/t/generic-directives-plugins-syntax/444)
named "raw", i.e. `:raw[text]` (inline-level), `::raw[text]` (paragraph-level) and `:::raw`
(block-level) where you can put text that is **guaranteed not to be touched** by _md2sv_ or by any
_Unified.js_ pipeline plugin like smart typography, syntax highlighting, or anything else.
Typically, you would use this feature for, but not limited to, Svelte code.
Following are a few examples.
##### The block version (using `:::raw`)
:::raw