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
This recent change broke all children with custom transformers when using blocksToMarkdown.
I understand the change was made to prevent some duplicate markdown from being created (#62), but I think a different solution is needed.
Consider the simple use case of a numbered list with sub items.
One
Sub one
If I call blocksToMarkdown on the first item, my numbered_list_item custom transformer used to be called for both items and both items would end up in the output.
Now, the child never makes it to the output at all.
This is true of any child with a custom transformer.
Was this an oversight?
Or did you intend that if a custom transformer was used that the transformer should be responsible for handling the type and all its children?
If the latter, could you provide an example of how this can most easily be accomplished?
The text was updated successfully, but these errors were encountered:
n2m.setCustomTransformer("numbered_list_item",async(block)=>{// deal with the block and it's children as per your needconsole.log(block);});
Custom transformer deals with that specific block type and one has to deal with the children of that block.
When the custom transformer doesn't return anything (like in the above snippet), it should parse the numbered_list_items normally. However, on replicating the issue it doesn't work as intended.
Before proceeding I would like to confirm if this is the problem you are facing.
I understand the change was made to prevent some duplicate markdown from being created (#62), but I think a different solution is needed.
Definitely, this is the issue and I am trying to come up with a alternative solution/
This recent change broke all children with custom transformers when using
blocksToMarkdown
.I understand the change was made to prevent some duplicate markdown from being created (#62), but I think a different solution is needed.
Consider the simple use case of a numbered list with sub items.
If I call blocksToMarkdown on the first item, my numbered_list_item custom transformer used to be called for both items and both items would end up in the output.
Now, the child never makes it to the output at all.
This is true of any child with a custom transformer.
Was this an oversight?
Or did you intend that if a custom transformer was used that the transformer should be responsible for handling the type and all its children?
If the latter, could you provide an example of how this can most easily be accomplished?
The text was updated successfully, but these errors were encountered: