stereobooster / jekyll-press

🚨 [deprecated] Minifier plugin for jekyll. Minifies all html, js, css files. Simple just drop it in solution. No Java required
MIT License
148 stars 13 forks source link

Minification of xml_escape <code> content #11

Closed OliverJAsh closed 11 years ago

OliverJAsh commented 11 years ago

I am using xml_escape to prepare my content for an RSS feed, but this means that when it is run through jekyll-press, new lines in code are minified and therefore lost.

For example:

&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&quot;widget&quot;&amp;gt;…&amp;lt;/div&amp;gt;
&amp;lt;div class=&quot;widget&quot;&amp;gt;…&amp;lt;/div&amp;gt;
&amp;lt;div class=&quot;widget&quot;&amp;gt;…&amp;lt;/div&amp;gt;
&amp;lt;div class=&quot;widget&quot;&amp;gt;…&amp;lt;/div&amp;gt;
&amp;lt;!-- Exception --&amp;gt;
&amp;lt;div class=&quot;widget widget-secondary&quot;&amp;gt;…&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

Becomes:

&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;div class="widget"&amp;gt;…&amp;lt;/div&amp;gt; &amp;lt;div class="widget"&amp;gt;…&amp;lt;/div&amp;gt; &amp;lt;div class="widget"&amp;gt;…&amp;lt;/div&amp;gt; &amp;lt;div class="widget"&amp;gt;…&amp;lt;/div&amp;gt; &amp;lt;!-- Exception --&amp;gt; &amp;lt;div class="widget widget-secondary"&amp;gt;…&amp;lt;/div&amp;gt; &lt;/code&gt;&lt;/pre&gt;

I think the only way to prevent this from happening is to prevent jekyll-press from minifying the file. Can you do that?

stereobooster commented 11 years ago

One of the way to solve your problem is to exclude your feed file from minifacation with some kind of setting in _config.yml. Something like:

jekyll-press:
  exclude: ['feed.xml']

What do you think about it?

OliverJAsh commented 11 years ago

That would be a perfect solution. Is this something that’s alright built into jekyll-press?

On 25 Nov 2012, at 13:52, stereobooster notifications@github.com wrote:

One of the way to solve your problem is to eclude your feed file from minifacation with some kind of setting in _config.yml. Something like:

jekyllpress: exclude: ['feed.xml'] What do you think about it?

— Reply to this email directly or view it on GitHub.

stereobooster commented 11 years ago

Not yet. I will do it.

OliverJAsh commented 11 years ago

Thank you!

On 25 Nov 2012, at 14:08, stereobooster notifications@github.com wrote:

Not yet. I will do it.

— Reply to this email directly or view it on GitHub.

stereobooster commented 11 years ago

Update jekyll-press and add settings (https://github.com/stereobooster/jekyll-press#settings)

stereobooster commented 11 years ago

Closing for now