# markdown-functions

> Some javascript functions to apply markdown formatting syntaxes into a textarea.

Latest version **1.0.0** (published 2019-03-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install markdown-functions
pnpm add markdown-functions
yarn add markdown-functions
bun add markdown-functions
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-03-02 |
| First published | 2019-02-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 1 |
| Unpacked size | 8.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Craig Martin |
| Maintainers | craigmichaelmartin |
| Keywords | javascript, markdown, vanilla |

## Links

- npm: https://www.npmjs.com/package/markdown-functions
- npm.io page: https://npm.io/package/markdown-functions

## Dependencies (1)

- [insert-at-the-caret](https://npm.io/package/insert-at-the-caret.md) ^1.0.0

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-03-02
- 0.0.4 — 2019-03-01
- 0.0.3 — 2019-03-01
- 0.0.2 — 2019-03-01
- 0.0.1 — 2019-02-25

## README

# `markdown-functions`

[![Build Status](https://travis-ci.org/craigmichaelmartin/markdown-functions.svg?branch=master)](https://travis-ci.org/craigmichaelmartin/markdown-functions)
[![Greenkeeper badge](https://badges.greenkeeper.io/craigmichaelmartin/markdown-functions.svg)](https://greenkeeper.io/)
[![codecov](https://codecov.io/gh/craigmichaelmartin/markdown-functions/branch/master/graph/badge.svg)](https://codecov.io/gh/craigmichaelmartin/markdown-functions)

## Installation

```bash
npm install --save markdown-functions
```

## What is `markdown-functions`?

`markdown-functions` are javascript functions to apply markdown formatting syntaxes into a textarea. They each accept an HTMLTextAreaElement. The functions intelligently handle selected text when applying the formatting, and for text styling transforms, they intelligently toggle on/off.

## Demo

`markdown-functions` power (`markdown-textarea-editor`)[https://github.com/craigmichaelmartin/markdown-textarea-editor] which has a demo https://craigmichaelmartin.github.io/markdown-textarea-editor/

## API

- `toggleBold(body: HTMLTextAreaElement)`
- `toggleItalics(body: HTMLTextAreaElement)`
- `toggleStrikethrough(body: HTMLTextAreaElement)`
- `toggleH1(body: HTMLTextAreaElement)`
- `toggleH2(body: HTMLTextAreaElement)`
- `toggleH3(body: HTMLTextAreaElement)`
- `toggleH4(body: HTMLTextAreaElement)`
- `addTab(body: HTMLTextAreaElement, url: string)`
- `addImage(body: HTMLTextAreaElement, url: string)`
- `addLink(body: HTMLTextAreaElement)`
- `addUnorderedList(body: HTMLTextAreaElement)`
- `addOrderedList(body: HTMLTextAreaElement)`

## TODO

- Add tests

---
_Source: https://npm.io/package/markdown-functions · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
