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

Commit

Permalink
refactor: Add Notion mark constants
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-baer committed Jun 23, 2019
1 parent e3c3cc4 commit ee173d1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ export const NOTION_BLOCKS = {
DIVIDER: 'divider',
COLLECTION_VIEW: 'collection_view'
};

export const NOTION_MARKS = {
BOLD: 'b',
ITALIC: 'i',
CODE: 'c',
HIGHLIGHT: 'h'
};
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { BLOCKS, MARKS, NOTION_BLOCKS } from './constants';
import { BLOCKS, MARKS, NOTION_BLOCKS, NOTION_MARKS } from './constants';
import isEmpty from './utils/is-empty';
import get from './utils/get';

const markMap = {
b: MARKS.BOLD,
i: MARKS.ITALIC,
c: MARKS.CODE,
h: MARKS.HIGHLIGHT
[NOTION_MARKS.BOLD]: MARKS.BOLD,
[NOTION_MARKS.ITALIC]: MARKS.ITALIC,
[NOTION_MARKS.CODE]: MARKS.CODE,
[NOTION_MARKS.HIGHLIGHT]: MARKS.HIGHLIGHT
};

function toMark(mark = []) {
Expand Down

0 comments on commit ee173d1

Please sign in to comment.