'Incorrect Conversion to JSON

I have html as character in R and trying to convert it to JSON using jsonlite package.

   toJSON("<span>ASD</span>")

It returns <\/span> instead of </span>

["<span>ASD<\/span>"]

cat(toJSON("<span>ASD</span>")) also returns the same conversion



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source