Closed jeroen closed 1 year ago
For example:
cat(commonmark::markdown_xml('A link: https://crandb.r-pkg.org is good', extensions = TRUE, sourcepos = TRUE))
now gives:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE document SYSTEM "CommonMark.dtd"> <document sourcepos="1:1-1:40" xmlns="http://commonmark.org/xml/1.0"> <paragraph sourcepos="1:1-1:40"> <text sourcepos="1:1-1:13" xml:space="preserve">A link: </text> <link sourcepos="1:8-1:32" destination="https://crandb.r-pkg.org" title=""> <text sourcepos="1:8-1:32" xml:space="preserve">https://crandb.r-pkg.org</text> </link> <text sourcepos="1:33-1:40" xml:space="preserve"> is good</text> </paragraph> </document>
Whereas in previous versions of commonmark it would give:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE document SYSTEM "CommonMark.dtd"> <document sourcepos="1:1-1:40" xmlns="http://commonmark.org/xml/1.0"> <paragraph sourcepos="1:1-1:40"> <text sourcepos="1:1-1:13" xml:space="preserve">A link: </text> <link destination="https://crandb.r-pkg.org" title=""> <text xml:space="preserve">https://crandb.r-pkg.org</text> </link> <text sourcepos="1:33-1:40" xml:space="preserve"> is good</text> </paragraph> </document>
Note how <link> has gained a sourcepos attribute. I think this is what causes them to be spellchecked.
<link>
sourcepos
@gaborcsardi
Actually this fixes the problem only for markdown vignettes, not Rd files...
Actually roxygen2 does not enable autolinking, so this never worked in Rd.
For example:
now gives:
Whereas in previous versions of commonmark it would give:
Note how
<link>
has gained asourcepos
attribute. I think this is what causes them to be spellchecked.@gaborcsardi