Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
Adds ability to add custom classes when adding a new block via class …
Browse files Browse the repository at this point in the history
…property in data object
  • Loading branch information
alberttoledo committed Sep 24, 2019
1 parent e77201e commit ac77297
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/util/blockStyleFn.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { Block } from './constants';
Get custom classnames for each of the different block types supported.
*/

const BASE_BLOCK_CLASS = 'md-block';

export default (block) => {
const classFromData = block.getData().class ? `${block.getData().class} ` : '';
const BASE_BLOCK_CLASS = `${classFromData}md-block`;

switch (block.getType()) {
case Block.BLOCKQUOTE:
return `${BASE_BLOCK_CLASS} ${BASE_BLOCK_CLASS}-quote md-RichEditor-blockquote`;
Expand Down

0 comments on commit ac77297

Please sign in to comment.