Question
Delete attribute from table on paste
Hello Adepters,
I would like to delete attributes from a table on paste using 5.4M070. For example when copying & pasting a row, delete @id on all elements including row, entry, and para. I have tried:
1) ACL paste callback that modifies xml in buffer_doc
2) JS AOMPaste event that accesses pasted xml using relatedRange
I've learned from testing and the forum, table markup is not accessible by object id when formatted (table markup is off).
With ACL, using oid to access the table components I saw the behavior:
(1) if an entire table is copied/pasted, all attributes on elements are deleted as wanted;
(2) if a row is copied/pasted, only the para has the attribute deleted. Interestingly, if a row is copied the paste buffer row is wrapped in table markup.
This behavior makes sense because the table and para tags are displayed in the Editor, unlike the other table markup that is hidden. Since object id (oid) does not work, I speculate accessing the table object id (toid) of the hidden parts might be an option instead, but I'm uncertain how to do this and if it's possible at all.
With JS, I did not pursue that any further because the row markup was not accessible, at least when I checked the markup was existent via event.relatedRange.toMarkupString().
Any recommendations? To simplify the process I want to avoid turning table markup on and handle it "auto-magically."
Thank you!
Bryan
I would like to delete attributes from a table on paste using 5.4M070. For example when copying & pasting a row, delete @id on all elements including row, entry, and para. I have tried:
1) ACL paste callback that modifies xml in buffer_doc
2) JS AOMPaste event that accesses pasted xml using relatedRange
I've learned from testing and the forum, table markup is not accessible by object id when formatted (table markup is off).
With ACL, using oid to access the table components I saw the behavior:
(1) if an entire table is copied/pasted, all attributes on elements are deleted as wanted;
(2) if a row is copied/pasted, only the para has the attribute deleted. Interestingly, if a row is copied the paste buffer row is wrapped in table markup.
This behavior makes sense because the table and para tags are displayed in the Editor, unlike the other table markup that is hidden. Since object id (oid) does not work, I speculate accessing the table object id (toid) of the hidden parts might be an option instead, but I'm uncertain how to do this and if it's possible at all.
With JS, I did not pursue that any further because the row markup was not accessible, at least when I checked the markup was existent via event.relatedRange.toMarkupString().
Any recommendations? To simplify the process I want to avoid turning table markup on and handle it "auto-magically."
Thank you!
Bryan

