Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOMParser matchTag does not check if nodeType is allowed by content spec of context nodes #951

Open
kapouer opened this issue Jul 15, 2019 · 5 comments

Comments

@kapouer
Copy link

kapouer commented Jul 15, 2019

I suppose it could check that node types content spec above parseContext.context allow the a rule's group.

@kapouer kapouer changed the title DOMParser matchTag does not check if group of nodeType is allowed within context DOMParser matchTag does not check if nodeType is allowed by content spec of context nodes Jul 15, 2019
kapouer added a commit to kapouer/prosemirror-model that referenced this issue Jul 15, 2019
kapouer added a commit to kapouer/prosemirror-model that referenced this issue Jul 16, 2019
@marijnh
Copy link
Member

marijnh commented Jul 16, 2019

It doesn't, and isn't supposed to. The placing of the resulting node will take care of this, parse rules are intended to apply regardless of context.

@kapouer
Copy link
Author

kapouer commented Jul 16, 2019

Well ok, but then something about that fails because it manages to place a type which is not allowed by content spec. E.g. two node types with a "p" tag but one allows only marks without links, and the other with links. Pasting a "p" in such a situation finds the type to be the first one declared, regardless of it being allowed or not in the context content spec.

@marijnh
Copy link
Member

marijnh commented Jul 17, 2019

Right, that's what the context field in the parse spec is for.

@kapouer
Copy link
Author

kapouer commented Jul 17, 2019

But then since #875 is a no no, you mean that context consistently fails in prosemirror.

@marijnh
Copy link
Member

marijnh commented Jul 18, 2019

you mean that context consistently fails in prosemirror.

Does it? It is used when selecting parse rules, which is what this was about, I believe.

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

No branches or pull requests

2 participants