Skip to content

Commit

Permalink
process the language name after putting together all help pages
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui authored Dec 9, 2024
1 parent 301ed94 commit a90c1cd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions R/package.R
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,6 @@ pkg_manual = function(
}, finally = close(con))
# extract body, which may end at </main> (R 4.4.x) or </div></body> (R 4.3.x)
txt = gsub('.*?(<h2[ |>].*)(</main>|</div>\\s*</body>).*', '\\1', one_string(txt))
# fix https://github.com/yihui/litedown/issues/52
txt = gsub("code class='language-R'", "code class='language-r'", txt, fixed = TRUE)
# free math from <code>
txt = gsub(r2, '<p>$$\\1$$</p>', txt)
txt = gsub(r1, '\\\\(\\1\\\\)', txt)
Expand Down Expand Up @@ -341,6 +339,7 @@ pkg_manual = function(
res = gsub('(<code[^>]*>)\\s+', '\\1', res)
res = gsub('\\s+(</code>)', '\\1', res)
res = gsub('<div class="sourceCode"><pre>(.+?)</pre></div>', '<pre><code>\\1</code></pre>', res)
res = gsub('<code class="language-R"', '<code class="language-r"', res, fixed = TRUE)
res = gsub('&#8288;', '', res, fixed = TRUE)
res = gsub('<table>', '<table class="table-full">', res, fixed = TRUE)

Expand Down

0 comments on commit a90c1cd

Please sign in to comment.