In R package Xaringan, unable to render with infinite moon reader

Using the R package xaringan, I was trying to create a new presentation in RStudio. I wanted to use the very useful feature inifinite moon reader to get live preview of my tweaking of the presentation. While worked nicely previously, currently for me the presentation is not rendering anymore. What changed in between is probably regular updates in software, operating system and R packages.

Now whenever I press the infinite moon reader addin in RStudio, it spits the error as shown in the image. But when I press the knit to moonreader button in RStudio it renders the document just fine but there is not live preview.

I tried to run R in a console and then used the inf_mr() function to render the document. It spits out the same error. But rmarkdown::render() function works just fine but again with no live preview. I searched for this error but I do not seem to find anything as such related to xaringan package in R. Then I ran a more generalized search and found that the error statement most often comes in the case of XML parsing. I updated the XML and XML2 packages in R but with no luck. Then I updated and upgraded my Arch Linux also to no avail.

Created on 2019-08-13 by the reprex package (v0.3.0)

devtools::session_info()
#> ─ Session info ──────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 3.6.1 (2019-07-05)
#>  os       Arch Linux                  
#>  system   x86_64, linux-gnu           
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_US.UTF-8                 
#>  ctype    en_US.UTF-8                 
#>  tz       Asia/Dhaka                  
#>  date     2019-08-13                  
#> 
#> ─ Packages ──────────────────────────────────────────────────────────────
#>  package     * version date       lib source        
#>  assertthat    0.2.1   2019-03-21 [1] CRAN (R 3.5.3)
#>  backports     1.1.4   2019-04-10 [1] CRAN (R 3.5.3)
#>  callr         2.0.4   2018-05-15 [1] CRAN (R 3.5.1)
#>  cli           1.1.0   2019-03-19 [1] CRAN (R 3.5.3)
#>  crayon        1.3.4   2017-09-16 [1] CRAN (R 3.5.1)
#>  curl          3.3     2019-01-10 [1] CRAN (R 3.5.3)
#>  desc          1.2.0   2018-05-01 [1] CRAN (R 3.5.3)
#>  devtools      2.0.2   2019-04-08 [1] CRAN (R 3.5.3)
#>  digest        0.6.20  2019-07-04 [1] CRAN (R 3.6.0)
#>  evaluate      0.14    2019-05-28 [1] CRAN (R 3.6.0)
#>  fs            1.3.1   2019-05-06 [1] CRAN (R 3.5.3)
#>  glue          1.3.1   2019-03-12 [1] CRAN (R 3.5.3)
#>  highr         0.8     2019-03-20 [1] CRAN (R 3.6.0)
#>  htmltools     0.3.6   2017-04-28 [1] CRAN (R 3.5.1)
#>  httr          1.4.0   2018-12-11 [1] CRAN (R 3.5.3)
#>  knitr         1.24    2019-08-08 [1] CRAN (R 3.6.0)
#>  magrittr      1.5     2014-11-22 [1] CRAN (R 3.5.1)
#>  memoise       1.1.0   2017-04-21 [1] CRAN (R 3.5.1)
#>  mime          0.7     2019-06-11 [1] CRAN (R 3.6.0)
#>  nvimcom     * 0.9-75  2019-08-13 [1] local         
#>  pkgbuild      1.0.3   2019-03-20 [1] CRAN (R 3.5.3)
#>  pkgload       1.0.2   2018-10-29 [1] CRAN (R 3.5.3)
#>  png           0.1-7   2013-12-03 [1] CRAN (R 3.5.3)
#>  prettyunits   1.0.2   2015-07-13 [1] CRAN (R 3.5.3)
#>  processx      3.2.0   2018-08-16 [1] CRAN (R 3.5.1)
#>  ps            1.1.0   2018-08-10 [1] CRAN (R 3.5.1)
#>  R6            2.4.0   2019-02-14 [1] CRAN (R 3.5.3)
#>  Rcpp          1.0.2   2019-07-25 [1] CRAN (R 3.6.0)
#>  remotes       2.0.4   2019-04-10 [1] CRAN (R 3.5.3)
#>  rlang         0.4.0   2019-06-25 [1] CRAN (R 3.6.0)
#>  rmarkdown     1.14    2019-07-12 [1] CRAN (R 3.6.0)
#>  rprojroot     1.3-2   2018-01-03 [1] CRAN (R 3.5.1)
#>  sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 3.5.3)
#>  stringi       1.4.3   2019-03-12 [1] CRAN (R 3.6.0)
#>  stringr       1.4.0   2019-02-10 [1] CRAN (R 3.6.0)
#>  testthat      2.1.1   2019-04-23 [1] CRAN (R 3.6.0)
#>  usethis       1.5.1   2019-07-04 [1] CRAN (R 3.6.0)
#>  withr         2.1.2   2018-03-15 [1] CRAN (R 3.5.1)
#>  xfun          0.8     2019-06-25 [1] CRAN (R 3.6.0)
#>  xml2          1.2.2   2019-08-09 [1] CRAN (R 3.6.0)
#>  yaml          2.2.0   2018-07-25 [1] CRAN (R 3.5.1)
#> 
#> [1] /home/arch/R/x86_64-pc-linux-gnu-library/3.6
#> [2] /usr/lib/R/library