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

Whitespace in <pre> tags #1

@andrewgunn

Description

@andrewgunn

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions