jeffreytse/jekyll-spaceship

View on GitHub
lib/jekyll-spaceship/processors/polyfill-processor.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module Jekyll::Spaceship
  class PolyfillProcessor < Processor
    priority :high

    def on_handle_markdown(content)
      # escape ordered list.
      rexp = /(\s*)(?<!\\)\\(?=\d+\.)/
      self.handled = true if content.match(rexp)
      content.gsub(rexp, '\1&#8291;')
    end
  end
end