Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Small adaptation for counting figures#767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
muschellij2 wants to merge2 commits intorstudio:main
base:main
Choose a base branch
Loading
frommuschellij2:master

Conversation

@muschellij2
Copy link

The PR forknitr atyihui/knitr#1752, which fixed the figure referencing issue in#766 and is discussed inrstudio/bookdown-demo#42, causes an unintended side effect of puttingid in front of class. As referenced inyihui/knitr#1752,
https://github.com/rstudio/bookdown/blob/master/R/html.R#L566 needs to be edited so that it can go<divjs-comment-update" data-type="json" data-turbo="false" action="/rstudio/bookdown/issues/767" accept-charset="UTF-8" method="post">

Copy link
Contributor

@yihuiyihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

In the PRyihui/knitr#1752, you wroteid afterclass, so I don't see why this PR is necessary if theknitr PR is merged. Could you help me understand it? Thanks!

labs= regmatches(content,m)
cntr= new_counters(label_types,chaps)# chapter counters
figs= grep('^<divpl-pds">',content)
figs= grep('^<div.*class="figure',content)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Does it make sense to make the regex stricter?

Suggested change
figs= grep('^<div.*class="figure',content)
figs= grep('^<div[^>]*?class="figure',content)

@muschellij2
Copy link
Author

muschellij2 commentedSep 5, 2019 via email

Yes I believe it makes it stronger. I don’t really understand but it seemslike after I knit the Document it re-ordered the arguments. I’ll check backwhen I’m in the office next week
On Thu, Sep 5, 2019 at 7:07 PM Yihui Xie ***@***.***> wrote: ***@***.**** commented on this pull request. In the PRyihui/knitr#1752 <yihui/knitr#1752>, you wrote id after class, so I don't see why this PR is necessary if the *knitr* PR is merged. Could you help me understand it? Thanks! ------------------------------ In R/html.R <#767 (comment)>: > @@ -563,7 +563,7 @@ parse_fig_labels = function(content, global = FALSE) { m = gregexpr(sprintf('\\(#((%s):[-/[:alnum:]]+)\\)', reg_label_types), content) labs = regmatches(content, m) cntr = new_counters(label_types, chaps) # chapter counters - figs = grep('^<divfigure', content) Does it make sense to make the regex stricter? ⬇️ Suggested change - figs = grep('^<div .*class="figure', content) + figs = grep('^<div [^>]*?class="figure', content) — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#767?email_source=notifications&email_token=AAIGPLQYFYF5D4GLB5UK5ETQIGGM3A5CNFSM4IRVAQM2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCD3HC2Y#pullrequestreview-284586347>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAIGPLWXW2L6SITF7AXMH5TQIGGM3ANCNFSM4IRVAQMQ> .
-- Best,John

@yihui
Copy link
Contributor

Okay. If Pandoc reordersid andclass in the div, then this PR makes perfect sense.

@CLAassistant
Copy link

CLAassistant commentedApr 17, 2024
edited
Loading

CLA assistant check
All committers have signed the CLA.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@yihuiyihuiyihui left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@muschellij2@yihui@CLAassistant

[8]ページ先頭

©2009-2025 Movatter.jp