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.

remove schema restriction on texts around inlines

See original GitHub issue

Do you want to request a feature or report a bug?

Debt.

What’s the current behavior?

Right now the core schema will always ensure that inline nodes are surrounded by text nodes. This was to ensure that when inserting text you can always insert on either side of the inline node.

However it’s a bit of an intense restriction, and results in the data model itself having extra “junk” in it.

What’s the expected behavior?

Instead, I think we may be able to solve this with editor queries. With a query like…

const point = editor.resolveInsertionPoint(point)

It could ensure that a text node exists to type into if we’re at the leading/trailing edge of an inline node. This would also be an override point for folks who want to implement “sticky” inlines.

(Slightly different than an editor.getInsertionPoint which you wouldn’t expect to change the document at all. And a reason for #2861 to reduce the arbitrary distinction between queries and commands.)

That way the restriction can be editor-level instead of data-level, resulting in more flexibility for people with advanced use cases.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ianstormtaylorcommented, Aug 20, 2019

I completely agree, I want the getInsertionPoint behavior to be overridable too. Another issue for it sounds good just to keep track.

As for data model that makes sense. I think my use case is probably pretty far out there in terms of architecture, so it might not make as much sense. (Although I think that’s generally a good thing for making sure the framework is well designed!)

Can you give me an example of your deserialization troubles? Just curious to see if there are ways to ease them.

Thanks!

0reactions
ianstormtaylorcommented, Aug 21, 2019

Ah okay, I didn’t realize it was all inside the normalization logic where the problems are. Having the multi-pass solution for performance sounds like it could be promising. And once we’ve dropped Immutable that will make it a bit less costly too hopefully.

Read more comments on GitHub >

github_iconTop Results From Across the Web

XML schema restriction pattern for not allowing empty strings
If the string contains only whitespace (line feeds, carriage returns, tabs, leading and trailing spaces), the processor will remove them so validation will ......
Read more >
W3C XML Schema Definition Language (XSD) 1.1 Part 1
This specification defines several attributes for direct use in any XML documents, as described in Schema-Related Markup in Documents Being ...
Read more >
Chapter 17 Binding between XML Schema and Java Classes
Unmarshal: XML documents written according to the constraints in the source schema are unmarshalled by the JAXB binding framework.
Read more >
Generate an Inline XSD Schema - SQL Server - Microsoft Learn
In the following query, both subelements are nonkey columns of the same type and can be NULL. SQL Copy. DROP TABLE T ...
Read more >
Specifying a schema | BigQuery - Google Cloud
Inline using the bq command-line tool. Using the CREATE TABLE SQL ... Option 2: Click Edit as text and paste the schema in...
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