From 4ab759a52beb4eae67991aa6fac564eee681da53 Mon Sep 17 00:00:00 2001 From: djoate <56777051+djoate@users.noreply.github.com> Date: Tue, 26 Nov 2019 04:57:07 -0500 Subject: [PATCH] Strip newlines from Weblate source --- _plugins/weblate-source-file.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_plugins/weblate-source-file.rb b/_plugins/weblate-source-file.rb index cfc23455..d894a597 100644 --- a/_plugins/weblate-source-file.rb +++ b/_plugins/weblate-source-file.rb @@ -34,7 +34,7 @@ module Weblate def add_entry(weblate_id, source_text) unless id_already_exists?(weblate_id) or source_text.nil? or source_text.empty? new_entry = <<-YAML -#{weblate_id}: | +#{weblate_id}: |- #{source_text} YAML @@ -44,7 +44,7 @@ module Weblate end def id_already_exists?(weblate_id) - File.readlines(weblate_source_location).grep(/^#{weblate_id}: \|$/).any? + File.readlines(weblate_source_location).grep(/^#{weblate_id}: \|-$/).any? end def refresh