From 1e2dba2630f5d260b7debfa3245f69640c667c13 Mon Sep 17 00:00:00 2001 From: maddiebaka Date: Thu, 3 Aug 2023 13:43:29 -0400 Subject: [PATCH] Remove old implementation of strip_markers --- lib/skeksis/parser.rb | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/lib/skeksis/parser.rb b/lib/skeksis/parser.rb index f6cb562..acf4f26 100644 --- a/lib/skeksis/parser.rb +++ b/lib/skeksis/parser.rb @@ -101,43 +101,6 @@ module Skeksis end - def strip_markers(gemtext) - gemtext.map do |line| - type = line[:type] - content = line[:content] - text = content[0] - - case type - when :blank - #{ type: type, content: nil } - { type: type } - when :header - m = /^(#+)(\s*)(.*)/.match(text) - level = m[1].count("#") - { type: type, level: level, content: [m[3]] } - when :list - { type: type, content: content.map { |t| t.sub(/^\*\s*/, "") } } - when :quote - { type: type, content: content.map { |t| t.sub(/^\>\s?/, "") } } - when :uri - a = text.sub(/^=>\s*/, "").split(" ", 2) - link = a[0] - text = a[1] - { type: type, link: link, text: text } - when :verbatim - # TODO: Match with syntax highlighting, maybe - m = /^```(.*)/.match(text) - unless m.nil? - nil - else - { type: type, content: content } - end - else - { type: type, content: content } - end - end.compact - end - def get_type(l) case l when ""