Sha256: e91c27c125c945cfde553d4ed57e1388dbaac26705524977b9170a52b2cf50a5
Contents?: true
Size: 417 Bytes
Versions: 8
Compression:
Stored size: 417 Bytes
Contents
# frozen_string_literal: true module Jekyll module TableOfContents # helper methods for Parser module Helper PUNCTUATION_REGEXP = /[^\p{Word}\- ]/u.freeze def generate_toc_id(text) text = text.downcase .gsub(PUNCTUATION_REGEXP, '') # remove punctuation .tr(' ', '-') # replace spaces with dash CGI.escape(text) end end end end
Version data entries
8 entries across 8 versions & 1 rubygems