Skip to content

Add noContent property to Node#69

Open
alanpoulain wants to merge 1 commit intoueberdosis:mainfrom
alanpoulain:feat-no-content
Open

Add noContent property to Node#69
alanpoulain wants to merge 1 commit intoueberdosis:mainfrom
alanpoulain:feat-no-content

Conversation

@alanpoulain
Copy link
Contributor

It can be useful to specify that an extension has no content at all, for instance when parsing a HTML node containing multiple tags (I added an example for a <blockquote> containing a <cite> tag).

In JS, it can be done by not using the content key:

export const BlockquoteCite = Node.create({
  name: 'blockquoteCite',
  group: "block",

  parseHTML() {}

In this PR, I propose to add a $noContent static property to Node to specify this behavior.
When set to true, the content key is not added to the array.

@alanpoulain
Copy link
Contributor Author

@timoisik Could you have a look at it? We need it for our project (we use a JSON version polluted by this content key).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant