0.7.13 • Published 4 years ago
@withbluedot/html-to-mobiledoc v0.7.13
HTML To Mobiledoc
Convert HTML strings into Mobiledoc objects.
Install
npm install @withbluedot/html-to-mobiledoc --save
or
yarn add @withbluedot/html-to-mobiledoc
Usage
const converter = require('@withbluedot/html-to-mobiledoc');
converter.toMobiledoc('<p>Hello World!</p>');By default, we use the parser plugins from @withbluedot/kg-parser-plugins, which convert to Ghost's cards.
To override this, pass in your own parser plugins:
converter.toMobiledoc('<p>Hello World!</p>', {plugins: []});You can also extend Ghost's plugins:
const plugins = require('@withbluedot/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.
1. git clone this repo & cd into it as usual
2. Run yarn to install top-level dependencies.
Run
yarn dev
Test
yarn lintrun just eslintyarn testrun lint and tests
Copyright & License
Copyright (c) 2013-2021 Ghost Foundation - Released under the MIT license.