Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

Downcast one element and its attributes into multiple elements, or dataDowncast version of upcastDispatcher.on('element:xx') #16793

Open
zach5355 opened this issue Jul 24, 2024 · 0 comments
Labels
type:question This issue asks a question (how to...).

Comments

@zach5355
Copy link

zach5355 commented Jul 24, 2024

📝 Ask a question

Hello we have an input item structure that looks like this where the dts are used for numbering and the dd is the content.

<dl attr1="1" attr2="2" attr3 = "3">
<dt><span>1</span></dt>
<dd>Test<dd>
<dd>Test2<dd>
</dl>

We needed to upcast a dt if it exists and the following dd, otherwise just the dd. We have this part working using the updastDispatcher.on('element:dt') and handling it all in there with our own logic.

This gets turned into an internal model like:

<foo>
<bar number="1" >Test</bar>
<bar number="2" hidden="true">Test2</bar>
</foo>

edit downcast works fine since each element can be downcast to its own element but for data downcast we need to go back to the original format meaning that each bar element needs to be turned into either one or two elements that are siblings depending on its attributes.

After looking through all the documentation I cannot find a similar way to do the dataDowcast like we did the upcast using a dispatcher and handling all the logic for all elements inside the foo element and just converting the entire section at once, or a way to turn the bar element into potentially two sibling elements.

Am I missing something, is there a way to accomplish this?

Thank you!

@zach5355 zach5355 added the type:question This issue asks a question (how to...). label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question This issue asks a question (how to...).
Projects
None yet
Development

No branches or pull requests

1 participant