Open zkamvar opened 4 years ago
Note that this issue ties closely with #27
After getting lost in namespace weeds a bit, it appears that this feature is definitely needed because there is no way to cleanly add nodes into the default namespace: https://community.rstudio.com/t/adding-nodes-in-xml2-how-to-avoid-duplicate-default-namespaces/84870/2
now that one can add Markdown, is this still needed?
Is it worthwhile to add helper functions for adding or extracting nodes? There is an issue around namespaces, which can be tricky. Things I think could be on the docket to add:
I think adding helper functions for these situations would be quite nice. The only thing is that the code block example is one of the simplest situations because you only need the code block and the text that goes inside. It gets more complex with almost any other element.
One avenue we might explore is having a helper function that inserts user markdown as nodes by passing it through
commonmark::markdown_xml()
and then taking the children of that new document. That's was one of the strategies I found to work with dealing with list elements in {pegboard}Originally posted by @zkamvar in https://github.com/ropensci/tinkr/pull/24#issuecomment-699036027