+
Skip to content

PCDATA invalid Char value #36

Closed
Closed
@billdenney

Description

@billdenney

I'm not sure if this is a bug in commonmark or xml2 I will report it here because I think that the issue is with the original encoding here. This happened when trying to use usethis::use_spell_check() on the janitor package.

When converting the attached NEWS.md file, I think that commonmark doesn't correctly parse and escape values. (The issue may be that xml2 doesn't correctly handle these values, though.)

text <- readLines("https://github.com/user-attachments/files/18189322/NEWS.md")
md <- commonmark::markdown_xml(text, sourcepos = TRUE)
doc <- xml2::xml_ns_strip(xml2::read_xml(md))
#> Error in read_xml.raw(charToRaw(enc2utf8(x)), "UTF-8", ..., as_html = as_html, : PCDATA invalid Char value 19 [9]

Created on 2024-12-18 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载