Skip to content
This repository has been archived by the owner on Nov 24, 2020. It is now read-only.

Whitespace in <pre> tags #1

Open
andrewgunn opened this issue Mar 26, 2013 · 0 comments
Open

Whitespace in <pre> tags #1

andrewgunn opened this issue Mar 26, 2013 · 0 comments

Comments

@andrewgunn
Copy link

The strip plugin is too aggressive and targets innocent whitespace inside <pre> tags so I've updated strip.rb to exclude it:

# Replaces multiple newlines and whitespace 
# between them with one newline

module Jekyll
  class StripTag < Liquid::Block

    def render(context)
      super.gsub /(?<=\s)\n\s*\n(?![^<>]*<\/pre>)/, "\n"
    end

  end
end

Liquid::Template.register_tag('strip', Jekyll::StripTag)
patrickwelker pushed a commit to patrickwelker/jekyll-strip that referenced this issue Apr 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant