question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid marks in schema are not removed

See original GitHub issue

Bug report

With this schema it shouldn’t be possible to have any marks in the heading-one block:

const schema = {
  blocks: {
    'heading-one': {
      nodes: [{ objects: ['text'] }],
      marks: []
    }
  }
};

But as you can see I’m able to insert bold text in it: image

What’s the current behavior?

You can see this behaviour in action here: https://youtu.be/mfI3U3KX9ug

To reproduce I’m just toggling a mark without actually making a selection and then simply writing.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
isubasticommented, Jun 4, 2018

@SmilinBrian you might want to use something like https://github.com/ianstormtaylor/slate-plugins/tree/master/packages/slate-auto-replace rather than validateNode for that

2reactions
zhujinxuancommented, May 2, 2018

@PierBover Yes, you can fix it here: packages/slate/src/changes/by-key in insertTextAtRange

  if (normalize !== undefined) {
    normalize = range.isExpanded
  }

to something like

  if (normalize !== undefined) {
    normalize = range.isExpanded && marks.size !== 0
  }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Deleting rows in BigQuery fails with "Invalid schema update"
I'm trying to delete some rows from ...
Read more >
Federation error codes - Apollo GraphQL Docs
INVALID_FEDERATION_SUPERGRAPH, Indicates that a schema provided for an Apollo Federation supergraph is not a valid supergraph schema. 2.1.0.
Read more >
8.7.2 Validating (Compiling) Invalid Schema Objects
Schema objects (such as triggers, procedures, or views) might be invalidated when changes are made to objects on which they depend. For example,...
Read more >
Uses the wrong schema, even when yaml.schemas is set #397
in yaml.schemas and the extension recognizes that the schema does not exist, so it is receiving the proper schema from settings.json !
Read more >
Setting crawler configuration options - AWS Glue
Remove any metadata that is not set by the crawler. ... Mark the table as deprecated in the Data Catalog – This is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found