Skip to content

The plugin force block style on first line for a heading/title. Alternatives to Medium Editor.

Notifications You must be signed in to change notification settings

null-none/draft-js-first-line-heading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

draft-js-first-line-heading

The plugin force block style on first line for a heading/title. Alternatives to Medium Editor.

Install

$ npm install draft-js-first-line-heading

Usage

import createFirstLineHeadingPLugin from 'draft-js-first-line-heading';
const firstLineHeading = createFirstLineHeadingPLugin();

...

const plugins = [firstLineHeading];

let lines = this.state.story.getCurrentContent().getPlainText().split('\n');
let title = lines[0];
lines.shift();
let body = lines.join('\n');

console.log(title, body)

...

License

MIT

About

The plugin force block style on first line for a heading/title. Alternatives to Medium Editor.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published