Code get out of bounds from html / Code is not wrapping

It's my first time using rmarkdown and also using distill. I've been working well while using default style for rmarkdown and html_document. My problem is that when I decided to change to distill_article I got a problem when code was displayed. I got into the default css and I found that if I remove the following line:

@media (min-width: 768px){
d-article pre, d-article div.sourceCode, d-article div.sourceCode pre {
overflow: hidden !important;
}
}

from the generated html, it works well but if I try to publish it I get error while publishing.

Is there a way to fix it?

Try using the markdown syntax by fencing with triple backticks.

Mmmm, maybe it could works. But I already solved it by just setting a css as a theme.

The css is like:

@media (min-width: 768px){
d-article pre, d-article div.sourceCode, d-article div.sourceCode pre {
overflow: auto !important;
}
}

I only add in that case bcs it only had problems when width was more the 768px.

What type of error do you get ?

If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.