@simtropolis/html-to-mobiledoc
v2.0.3
Published
Convert HTML strings into Mobiledoc objects.
Readme
HTML To Mobiledoc
Convert HTML strings into Mobiledoc objects.
Install
npm install @simtropolis/html-to-mobiledoc --save
or
yarn add @simtropolis/html-to-mobiledoc
Usage
const converter = require('@simtropolis/html-to-mobiledoc');
converter.toMobiledoc('<p>Hello World!</p>');By default, we use the parser plugins from @simtropolis/kg-parser-plugins, which convert to Simtropolis's cards.
To override this, pass in your own parser plugins:
converter.toMobiledoc('<p>Hello World!</p>', {plugins: []});You can also extend Simtropolis's plugins:
const plugins = require('@simtropolis/kg-parser-plugins');
const myPlugin = (node) => {
// do stuff
};
plugins.push(myPlugin);Develop
This is a mono repository, managed with lerna.
Follow the instructions for the top-level repo.
git clonethis repo &cdinto it as usual- Run
yarnto install top-level dependencies.
Run
yarn dev
Test
yarn lintrun just eslintyarn testrun lint and tests
Copyright & License
Copyright (c) 2020-2022 Simtropolis - Released under the MIT license.
