# commonform-new-markup

> Parse Common Form markup, returning an object containing a form and an array of path-to-blank mappings.

Latest version **0.2.1** (published 2015-11-02) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install commonform-new-markup
pnpm add commonform-new-markup
yarn add commonform-new-markup
bun add commonform-new-markup
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2015-11-02 |
| First published | 2015-10-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kyle E. Mitchell |
| Maintainers | kemitchell |

## Links

- npm: https://www.npmjs.com/package/commonform-new-markup
- Repository: https://github.com/commonform/commonform-new-markup
- Homepage: https://github.com/commonform/commonform-new-markup#readme
- Issues: https://github.com/commonform/commonform-new-markup/issues
- npm.io page: https://npm.io/package/commonform-new-markup

## Dependencies (2)

- [string-repeat](https://npm.io/package/string-repeat.md) ^1.1.1
- [commonform-fix-strings](https://npm.io/package/commonform-fix-strings.md) ^0.2.2

## Recent versions

- 0.2.1 (latest) — 2015-11-02
- 0.2.0 — 2015-10-30

## README

Parse Common Form markup, returning an object containing a form and an array of path-to-blank mappings.

```javascript
var parse = require('commonform-markup-parse')
parse(stringOfMarkup); // => { form: Object, directions: Array }
```

The parser is made of several components:

1. a hand-coded context-tracking tokenizer (or lexer) that emits tokens for indentation and outdentation, in addition to content tokens
2. an LALR(1) parser generated by [Jison](https://npmjs.com/packages/jison) from a Bison-like BNF grammar
3. [commonform-fix-strings](https://npmjs.com/commonform-fix-strings) to convert the parser's AST to a valid common form by fixing various string-related validation issues, like extra space
4. a tiny algorithm that removes the hints text from fill-in-the-blanks within the form, and emits path-to-hint mappings instead

The parser passes the [commonform-markup-tests](https://npmjs.com/packages/commonform-markup-tests) test suite.

If you'd like to write a parser in a different language, the test suite and this package are best places to start. Your language probably already has a Bison clone or a BNF-compatible parser combinators library.

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