Skip to content

Commit

Permalink
Bump prosemirror-model to 1.22.3
Browse files Browse the repository at this point in the history
  • Loading branch information
nlam-atlassian committed Oct 8, 2024
1 parent 653e3a8 commit e37c86f
Show file tree
Hide file tree
Showing 28 changed files with 1,455 additions and 1,097 deletions.
2 changes: 2 additions & 0 deletions model/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ implementation("com.atlassian.prosemirror:model:1.0.2")
```

### Versioning
- Implemented changes to match version [1.22.3](https://github.com/ProseMirror/prosemirror-model/releases/tag/1.22.3)
of prosemirror-model
705 changes: 378 additions & 327 deletions model/config/ktlint/baseline.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,28 @@ class Fragment {
leafText: ((leafNode: Node) -> String?)?
): String {
var text = ""
var separated = true
var first = true
val func: (node: Node, start: Int, parent: Node?, index: Int) -> Boolean = { node, pos, parent, index ->
if (node.isText) {
node.text?.let {
text += it.slice(max(from, pos) - pos, to - pos)
}
separated = blockSeparator == null
} else if (node.isLeaf) {
if (leafText != null) {
text += leafText(node)
} else if (node.type.spec.leafText != null) {
text += node.type.spec.leafText!!.invoke(node)
val nodeText = if (node.isText) {
node.text?.slice(max(from, pos) - pos, to - pos) ?: ""
} else if (!node.isLeaf) {
""
} else if (leafText != null) {
leafText(node)
} else if (node.type.spec.leafText != null) {
node.type.spec.leafText!!.invoke(node)
}
else {
""
}
if (node.isBlock && (node.isLeaf && nodeText != null || node.isTextblock) && blockSeparator != null) {
if (first) {
first = false
} else {
text += blockSeparator
}
separated = blockSeparator == null
} else if (!separated && node.isBlock) {
text += blockSeparator
separated = true
}
text += nodeText
true
}
this.nodesBetween(
Expand Down Expand Up @@ -255,7 +259,7 @@ class Fragment {
}

// Find the index and inner offset corresponding to a given relative position in this fragment.
// The result object will be reused (overwritten) the next time the function is called. (Not public.)
// The result object will be reused (overwritten) the next time the function is called. @internal
fun findIndex(pos: Int, round: Int = -1): Index {
if (pos == 0) return retIndex(0, pos)
if (pos == this.size) return retIndex(this.content.size, pos)
Expand Down
Loading

0 comments on commit e37c86f

Please sign in to comment.