You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if body is empty ,selecting it and adding an element from “add menu” inserts the element inside but when not, it gives validation error. @atulbhatt-system32 this is related.
currently, adding things inside forbidden things is going crazy (try placing a link inside a link). here's a defined way to do it bottom-up.
note for beginners: this functionality involved contextual data coming from "rfrncs"
add menu: always show options - display all possible html elements in the add menu, no matter the current context.
check context: when adding/moving/pasting an element, see if it fits in the current context.
look for parent: if it doesn't fit, check higher-level contexts and add the element(s) there if it's allowed. if one element out of a few is violating, then the fallback rules applies to them too.
ignore if not allowed: if no valid context is found, terminate the action and pop a notification for it - "Anchor inside Anchor is not allowed".
example 1: within an empty 'body,' adding a 'div' should place it inside the 'body.'
example 2: inside a 'ul' element and selecting a 'li,' adding another 'li' should put it next to the previous one. adding a 'div' will place it outside the 'ul.'
paste mechanism:
follow same rules: use the same context rules when pasting elements.
keep tree order: paste elements in the order they appear in the tree, not the initial selection order.
multi-element addition:
all-or-nothing: if any element in a multi-addition is not allowed, cancel the entire operation.
case-by-case handling: if all elements are allowed, apply the usual context rules to each one.
The text was updated successfully, but these errors were encountered:
if body is empty ,selecting it and adding an element from “add menu” inserts the element inside but when not, it gives validation error. @atulbhatt-system32 this is related.
currently, adding things inside forbidden things is going crazy (try placing a link inside a link). here's a defined way to do it bottom-up.
note for beginners: this functionality involved contextual data coming from "rfrncs"
example 1: within an empty 'body,' adding a 'div' should place it inside the 'body.'
example 2: inside a 'ul' element and selecting a 'li,' adding another 'li' should put it next to the previous one. adding a 'div' will place it outside the 'ul.'
paste mechanism:
multi-element addition:
The text was updated successfully, but these errors were encountered: