Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

change to public fields of tag#10

Merged
marijnh merged 2 commits intoProseMirror:masterfrom
MH4GF:add-field-for-node-builder
Jul 23, 2022
Merged

change to public fields of tag#10
marijnh merged 2 commits intoProseMirror:masterfrom
MH4GF:add-field-for-node-builder

Conversation

@MH4GF
Copy link
Copy Markdown
Contributor

@MH4GF MH4GF commented Jul 14, 2022

These fields would be very useful to have available for testing,
I would like to make them available to the public.

These fields would be very useful to have available for testing,
I would like to make them available to the public.
@MH4GF MH4GF marked this pull request as ready for review July 14, 2022 13:25
@marijnh
Copy link
Copy Markdown
Member

marijnh commented Jul 21, 2022

In what situations are they useful?

@MH4GF
Copy link
Copy Markdown
Contributor Author

MH4GF commented Jul 22, 2022

https://github.com/ProseMirror/prosemirror-schema-list/blob/aa6f2a6c42ee0c23406b39a818d92f691068773e/test/test-commands.ts#L7-L15
Since tag returns pos, defining such a selFor() function has the advantage that the selection can be defined declaratively, increasing the readability of the test.

@marijnh
Copy link
Copy Markdown
Member

marijnh commented Jul 22, 2022

Ah, you are talking about tag, not flat. I guess adding that to the return type there could make this a little more ergonomic. Adding flat seems to serve little purpose though (and is in fact incorrect, since that's not a property being added to Node instances, but an internally used alternative return type)

@MH4GF
Copy link
Copy Markdown
Contributor Author

MH4GF commented Jul 22, 2022

@marijnh thank you for response, Certainly for my use case, only tag was sufficient and I could not think of a case where flat would be needed. removed it: a9cb60b

@MH4GF MH4GF changed the title change to public fields of flat and tag change to public fields of tag Jul 22, 2022
@marijnh marijnh merged commit 9437fa0 into ProseMirror:master Jul 23, 2022
@MH4GF MH4GF deleted the add-field-for-node-builder branch July 25, 2022 11:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants