Sha256: a26617cf466458fb77b00c3dceac3f9c9f2148e061830526f6dc7d2499825115
Contents?: true
Size: 900 Bytes
Versions: 27
Compression:
Stored size: 900 Bytes
Contents
# ------------------------------------------------------------------------------ # ~/_plugins/simple_search_filter.rb # Liquid filter's to be used with JekyllSimple Search # # Product/Info: # http://jekyll.one # # Copyright (C) 2019 Juergen Adams # # J1 Template is licensed under the MIT License. # See: https://github.com/jekyll-one/j1_template_mde/blob/master/LICENSE # # ------------------------------------------------------------------------------ module Jekyll module CharFilter def remove_chars(input) input.gsub! '\\','\' input.gsub! /\t/, ' ' input.strip_control_and_extended_characters end end end Liquid::Template.register_filter(Jekyll::CharFilter) class String def strip_control_and_extended_characters() chars.each_with_object("") do |char, str| str << char if char.ascii_only? and char.ord.between?(32,126) end end end
Version data entries
27 entries across 27 versions & 1 rubygems