unified-doc-parse-text

unified-doc parser to parse text content into a hast tree with a single text node.

deprecated and replaced by unified-doc-parse-code-block
Last updated a month ago by chrisrzhou .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install unified-doc-parse-text 
SYNC missed versions from official npm registry.

unified-doc-parse-text

unified-doc parser to parse text content into a hast tree with a single text node.

Install

npm install unified-doc-parse-text

Use

import text from "unified-doc-parse-text";
import unified from "unified";

const processor = unified().use(text);
const content = "\na to the \nb to the \n\nc to the d";

expect(processor.parse(content)).toEqual({
  type: 'root',
  children: [
    {
      type: 'text',
      value: '\na to the \nb to the \n\nc to the d',
      position: {
        start: {
          column: 1,
          line: 1,
          offset: 0,
        },
        end: {
          column: 20,
          line: 1,
          offset: 19,
        },
      },
    },
  ],
  position: {
    start: {
      column: 1,
      line: 1,
      offset: 0,
    },
    end: {
      column: 20,
      line: 1,
      offset: 19,
    },
  },
});

API

function parse(): void;

Use the parser with any unified processor.

Current Tags

  • 0.1.0-beta.0                                ...           beta (4 months ago)
  • 1.0.3                                ...           latest (a month ago)

11 Versions

  • 1.0.3 [deprecated]           ...           a month ago
  • 1.0.2 [deprecated]           ...           a month ago
  • 1.0.1 [deprecated]           ...           2 months ago
  • 1.0.0 [deprecated]           ...           2 months ago
  • 0.1.6-beta.0                                ...           2 months ago
  • 0.1.5-beta.0                                ...           3 months ago
  • 0.1.4-beta.0                                ...           4 months ago
  • 0.1.3-beta.0                                ...           4 months ago
  • 0.1.2-beta.0                                ...           4 months ago
  • 0.1.1-beta.0                                ...           4 months ago
  • 0.1.0-beta.0                                ...           4 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 35
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |