Skip to content
New issue

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

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Pandoc 2.17 will now auto wrap HTML content, which could break our process #1304

Closed
cderv opened this issue Jan 24, 2022 · 5 comments
Closed

Comments

@cderv
Copy link
Collaborator

cderv commented Jan 24, 2022

In Pandoc 2.17, --wrap is now taken into account by HTML output. The default automatic wrapping applies. This will probably breaks some of our process (as bookdown not optimally uses regex matching / parsins on line by line basis)

I believe jgm/pandoc#7862 is related to that as process_markdown() will run pandoc_convert() on HTML to parse the reference.

It is possible this change affect other part of the process. We should probably set --wrap = "none" for all bookdown output format.

@yihui
Copy link
Member

yihui commented Jan 24, 2022

Currently we are using --wrap=preserve but I don't remember the specific reason now:

bookdown/R/html.R

Lines 78 to 82 in 236e07b

# add --wrap=preserve to pandoc args for pandoc 2.0:
# https://github.com/rstudio/bookdown/issues/504
pandoc_args2 = function(args) {
if (pandoc2.0() && !length(grep('--wrap', args))) c('--wrap', 'preserve', args) else args
}

@cderv
Copy link
Collaborator Author

cderv commented Jan 24, 2022

Oh I missed that. 🤔
From pandoc doc.

With preserve, pandoc will attempt to preserve the wrapping from the source document (that is, where there are nonsemantic newlines in the source, there will be nonsemantic newlines in the output as well)

Original change in Pandoc is jgm/pandoc#7764

From release not https://pandoc.org/releases.html#pandoc-2.17-2022-01-12 I understood that --wrap had no effect on HTML

Previously the HTML writer was exceptional in not being sensitive to the --wrap option.

But maybe I should use preserve then 🤔
That would explain why #1301 would be the only related issue to that.

@cderv
Copy link
Collaborator Author

cderv commented Jan 24, 2022

Maybe I should use pandoc_args2() as a fix in #1305 :think? I'll try to see if that fixes it too.

@cderv
Copy link
Collaborator Author

cderv commented Jan 24, 2022

I think the fact that we are setting --wrap to preserve is preventing us another issue by this Pandoc 2.17 change.

I'll close and reopen if we found something else later on.

@github-actions
Copy link

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 27, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants