Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Post nodes no longer store closed and open, but all their markups
- Loading branch information
Showing
16 changed files
with
196 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
export const IMAGE_SECTION_TYPE = 'image-section'; | ||
|
||
export default class Image { | ||
constructor() { | ||
this.type = 'imageSection'; | ||
this.type = IMAGE_SECTION_TYPE; | ||
this.src = null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
const MARKUP_TYPE = 'markup'; | ||
export const MARKUP_TYPE = 'markup'; | ||
export const VALID_MARKUP_TAGNAMES = [ | ||
'b', | ||
'i', | ||
'strong', | ||
'em', | ||
'a', | ||
'li' | ||
]; | ||
|
||
export default class Markup { | ||
constructor(tagName, attributes={}) { | ||
constructor(tagName, attributes=[]) { | ||
this.tagName = tagName.toLowerCase(); | ||
this.attributes = attributes; | ||
this.type = MARKUP_TYPE; | ||
|
||
if (VALID_MARKUP_TAGNAMES.indexOf(this.tagName) === -1) { | ||
throw new Error(`Cannot create markup of tagName ${tagName}`); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.