lib/pretty_strings.rb in pretty_strings-0.2.0 vs lib/pretty_strings.rb in pretty_strings-0.3.0
- old
+ new
@@ -9,10 +9,11 @@
end
def pretty
return '' if text.nil? || text.empty?
remove_bracketed_numbers(
+ remove_consecutive_dots(
replace_symbol_with_bracket(
remove_newlines(
replace_tabs(
remove_bracketed_code(
scan_for_code(
@@ -21,11 +22,11 @@
replace_bracket_with_symbol(
escape_text(
sanitize_text(
replace_bracket_with_symbol(
text
- )))))))))))).squeeze(" ").strip
+ ))))))))))))).squeeze(" ").strip
end
private
def remove_newlines(text)
@@ -47,9 +48,13 @@
text.gsub!(/(?<=\*\*\{email)\}(?=\*\*)/, '♚') || text
text.gsub!(/(?<=\*\*\{url)\}(?=\*\*)/, '♚') || text
text.gsub!(/\{.*?\}/, '') || text
text.gsub!(/♚/, '}') || text
text.gsub!(/⚘/, '{') || text
+ end
+
+ def remove_consecutive_dots(text)
+ text.gsub!(/\.{5,}/, '') || text
end
def replace_bracket_with_symbol(text)
text.gsub!(/<(?=\s*\d+)/, '♳') || text
end