mikser-io-render-metatext
v4.0.0
Published
Metatext helpers for [Mikser](https://github.com/almero-digital-marketing/mikser-io). Adds two functions to the render runtime — `metatext` and `removeMetatext` — for converting a compact bracket-based markup into HTML (or stripping it out).
Downloads
53
Readme
mikser-io-render-metatext
Metatext helpers for Mikser. Adds two functions to the render runtime — metatext and removeMetatext — for converting a compact bracket-based markup into HTML (or stripping it out).
Use this for short-form rich text where full Markdown is overkill — ad copy, social captions, taglines, button labels, anything where the author wants (bold) and [italic] without the cognitive load of ** and _ rules. Available in every template engine via the render runtime.
Install
npm install mikser-io-render-metatextUsage
// mikser.config.js
import { renderMetatext } from 'mikser-io-render-metatext'
export default {
plugins: [renderMetatext()]
}In any template the helpers are available on the render runtime:
{{metatext "[italic] (bold) {underline}"}}
{{removeMetatext meta.summary}}Mapping
| Source | Becomes |
|--------|---------|
| < … > | <s>…</s> (strikethrough) |
| { … } | <u>…</u> (underline) |
| ( … ) | <b>…</b> (bold) |
| [ … ] | <i>…</i> (italic) |
| \| | <br> |
| _ | <hr> |
| ~ | |
removeMetatext strips the same characters, replacing \|, _, and ~ with a single space.
Both helpers throw if their input is not a string.
License
ISC
