lib/wcc/contentful/app/markdown_renderer.rb in wcc-contentful-app-1.2.0 vs lib/wcc/contentful/app/markdown_renderer.rb in wcc-contentful-app-1.2.1
- old
+ new
@@ -48,11 +48,11 @@
raw_classes.each { |klass| text_without_markdown_class_syntax.slice!(klass) }
text_without_markdown_class_syntax
end
def links_within_markdown(text)
- text.scan(/(\[(.*?)\]\((.*?)\)(\{\:.*?\})?)/)
+ text.scan(/(\[(.*?)\]\((.*?)\)(\{:.*?\})?)/)
end
def gather_links_with_classes_data(markdown_links)
links_with_classes_arr = []
raw_classes_arr = []
@@ -73,24 +73,24 @@
end
def url_and_title(markdown_link_and_title)
match =
markdown_link_and_title.scan(
- /(\s|^)(https?:\/\/\S*|^\/\S*\/*\S*|^#\S*|mailto:\S*)(?=\s|$)|(\".*?\")/
+ /(\s|^)(https?:\/\/\S*|^\/\S*\/*\S*|^#\S*|mailto:\S*)(?=\s|$)|(".*?")/
)
url = match[0][1]
title = match[1] ? match[1][2] : nil
[url, title]
end
def capture_individual_classes(classes)
- classes.scan(/\.[^\.\}\s]*/)
+ classes.scan(/\.[^.}\s]*/)
end
def combine_individual_classes_to_one_string(classes)
class_string = ''
classes.each do |klass|
- class_string += klass.tr('.', '') + ' '
+ class_string += "#{klass.tr('.', '')} "
end
class_string
end
end