lib/immosquare-cleaner.rb in immosquare-cleaner-0.1.10 vs lib/immosquare-cleaner.rb in immosquare-cleaner-0.1.11

- old
+ new

@@ -1,9 +1,10 @@ require "English" require "immosquare-yaml" require "immosquare-extensions" require_relative "immosquare-cleaner/configuration" +require_relative "immosquare-cleaner/markdown" require_relative "immosquare-cleaner/railtie" if defined?(Rails) ##===========================================================================## ## Importing the 'English' library allows us to use more human-readable ## global variables, such as $INPUT_RECORD_SEPARATOR instead of $/, @@ -88,9 +89,20 @@ formated = parsed_data.to_beautiful_json File.write(file_path, formated) normalize_last_line(file_path) return end + + ##============================================================## + ## Markdown files + ##============================================================## + if file_path.end_with?(".md", ".md.erb") + formatted_md = ImmosquareCleaner::Markdown.clean(file_path) + File.write(file_path, formatted_md) + normalize_last_line(file_path) + return + end + ##============================================================## ## Autres formats ##============================================================## prettier_parser = nil