rundel / md4r

An R wrapper for the md4c markdown parsing library
https://rundel.github.io/md4r/
Other
4 stars 1 forks source link

Code in dense bullet lists #8

Closed krlmlr closed 5 months ago

krlmlr commented 6 months ago

This seems to be the most serious issue with roundtripping NEWS.md files at this time. I can work around for now by adding the paragraph myself, a fix would be great, though.

library(md4r)

md <- "
- `my_fun()` replaces
- `my_fun()` replaces
"

writeLines(to_md(parse_md(md)))
#> - `my_fun()`
#>  replaces
#> - `my_fun()`
#>  replaces

Created on 2024-03-03 with reprex v2.1.0

krlmlr commented 6 months ago

I'm having a hard time manipulating an existing md object. I wonder if we need $<-.md_node() and similar methods.

rundel commented 6 months ago

I think this should fix the basic issue

library(md4r)

md <- "
- `my_fun()` replaces
- `my_fun()` replaces
"

writeLines(to_md(parse_md(md)))
#> - `my_fun()` replaces
#> - `my_fun()` replaces

Created on 2024-03-08 with reprex v2.1.0

rundel commented 6 months ago

Do you have a couple of quick examples of what you'd like to do with $<-.md_node()?

krlmlr commented 5 months ago

I'd like to tweak the parse tree.

The fix works beautifully!