Narnia's Poofy Meatcleaver

    @tryghost/html-to-mobiledoc

    1.8.23 • Public • Published

    HTML To Mobiledoc

    Convert HTML strings into Mobiledoc objects.

    Install

    npm install @tryghost/html-to-mobiledoc --save

    or

    yarn add @tryghost/html-to-mobiledoc

    Usage

    const converter = require('@tryghost/html-to-mobiledoc');
    converter.toMobiledoc('<p>Hello World!</p>');

    By default, we use the parser plugins from @tryghost/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('@tryghost/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 lint run just eslint
    • yarn test run lint and tests

    Copyright & License

    Copyright (c) 2013-2022 Ghost Foundation - Released under the MIT license.

    Keywords

    none

    Install

    npm i @tryghost/html-to-mobiledoc

    DownloadsWeekly Downloads

    15,533

    Version

    1.8.23

    License

    MIT

    Unpacked Size

    2.35 MB

    Total Files

    14

    Last publish

    Collaborators

    • jonhickman
    • dylansharp
    • isabelfisher
    • lenabaidakova
    • kernalghost
    • hadret
    • minimaluminium
    • ronaldlangeveld
    • simonbackx
    • moreofmorris
    • joeegrigg
    • sanne-san
    • djordjevlais
    • bobvaneck
    • zimoatghost
    • allouis
    • gargol
    • rishabhgrg
    • erisds
    • johnonolan
    • kevinansfield
    • cobbspur
    • aileencgn
    • jloh
    • daniellockyer
    • sam-lord
    • pauladamdavis