File obs-server-2.10-0123-Unescape-carriage-return-char-in-nokogiri-xml-output.patch of Package obs-server

From e0f9772c7d4f020f011b59e269709e92019c8290 Mon Sep 17 00:00:00 2001
From: Lukas Krause <lkrause@suse.de>
Date: Tue, 13 Oct 2020 17:21:19 +0200
Subject: [PATCH] Unescape carriage return char in nokogiri xml output

The carriage return character '\r' gets escaped by
nokogiri/libxml which causes the character to be
rendered in the xml output.

https://github.com/sparklemotion/nokogiri/issues/1356

Since this is a valid xml char we can workaround this problem
by unescaping it again.

Fixes #10272
---
 src/api/config/initializers/nokogiri_builder.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/api/config/initializers/nokogiri_builder.rb b/src/api/config/initializers/nokogiri_builder.rb
index 4d25d6e63e..5f4083d599 100644
--- a/src/api/config/initializers/nokogiri_builder.rb
+++ b/src/api/config/initializers/nokogiri_builder.rb
@@ -10,8 +10,8 @@ module ActionView
       def call(template)
         'xml = ::Nokogiri::XML::Builder.new { |xml|' +
           template.source +
-          "}.to_xml :indent => 2, :encoding => 'UTF-8',
-            :save_with => Nokogiri::XML::Node::SaveOptions::NO_DECLARATION | Nokogiri::XML::Node::SaveOptions::FORMAT;"
+          "}.to_xml(:indent => 2, :encoding => 'UTF-8',
+            :save_with => Nokogiri::XML::Node::SaveOptions::NO_DECLARATION | Nokogiri::XML::Node::SaveOptions::FORMAT).gsub('&#13;', '\r')"
       end
     end
   end
-- 
2.31.1