ropensci / tinkr

Convert (R)Markdown files to XML, edit them, write them back as (R)Markdown
https://docs.ropensci.org/tinkr
GNU General Public License v3.0
57 stars 3 forks source link

add recursive function to find currency dollars #123

Open zkamvar opened 1 month ago

zkamvar commented 1 month ago

This adds a stronger solution to #121.

It does a second check to see if there are more opening dollar signs than closing and then passes those through a function that walks the list of broken math elements and detects the opening elements that aren't paired with closing elements (by confirming that the pairs are adjacent). The opening elements that aren't paired are excluded from the list and then if the list is still not balanced an error is thrown.