Hello community,

here is the log from the commit of package rubygem-reverse_markdown for 
openSUSE:Factory checked in at 2020-03-07 21:39:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-reverse_markdown (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-reverse_markdown.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-reverse_markdown"

Sat Mar  7 21:39:41 2020 rev:2 rq:773843 version:1.4.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/rubygem-reverse_markdown/rubygem-reverse_markdown.changes
        2019-09-02 13:25:26.969311303 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-reverse_markdown.new.26092/rubygem-reverse_markdown.changes
     2020-03-07 21:39:45.108333456 +0100
@@ -1,0 +2,12 @@
+Mon Feb 10 15:36:47 UTC 2020 - Stephan Kulow <co...@suse.com>
+
+- updated to version 1.4.0
+ see installed CHANGELOG.md
+
+  ## 1.4.0 – January 2020
+  - BREAKING: jump links will no longer be ignored but treated as links, see 
#82
+  
+  ## 1.3.0 - September 2019
+  - Add support for `s` HTML tag, thanks @fauno
+
+-------------------------------------------------------------------

Old:
----
  reverse_markdown-1.2.0.gem

New:
----
  reverse_markdown-1.4.0.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-reverse_markdown.spec ++++++
--- /var/tmp/diff_new_pack.3MbTqw/_old  2020-03-07 21:39:45.604333791 +0100
+++ /var/tmp/diff_new_pack.3MbTqw/_new  2020-03-07 21:39:45.612333796 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package rubygem-reverse_markdown
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,7 +12,7 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
@@ -24,16 +24,16 @@
 #
 
 Name:           rubygem-reverse_markdown
-Version:        1.2.0
+Version:        1.4.0
 Release:        0
 %define mod_name reverse_markdown
 %define mod_full_name %{mod_name}-%{version}
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-BuildRequires:  ruby-macros >= 5
-BuildRequires:  %{ruby}
 BuildRequires:  %{rubygem gem2rpm}
+BuildRequires:  %{ruby}
+BuildRequires:  ruby-macros >= 5
 BuildRequires:  update-alternatives
-Url:            http://github.com/xijo/reverse_markdown
+URL:            http://github.com/xijo/reverse_markdown
 Source:         https://rubygems.org/gems/%{mod_full_name}.gem
 Source1:        gem2rpm.yml
 Summary:        Convert html code into markdown
@@ -58,7 +58,6 @@
 find %{buildroot}/%{_libdir}/ruby/gems \( -name .gitignore -o -name 
.travis.yml -o -name .rspec \) | xargs rm
 # /MANUAL
 
-
 %gem_packages
 
 %changelog

++++++ reverse_markdown-1.2.0.gem -> reverse_markdown-1.4.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md    2019-08-22 15:18:56.000000000 +0200
+++ new/CHANGELOG.md    2020-01-07 19:15:40.000000000 +0100
@@ -1,6 +1,12 @@
 # Change Log
 All notable changes to this project will be documented in this file.
 
+## 1.4.0 – January 2020
+- BREAKING: jump links will no longer be ignored but treated as links, see #82
+
+## 1.3.0 - September 2019
+- Add support for `s` HTML tag, thanks @fauno
+
 ## 1.2.0 - August 2019
 - Handle windows `\r\n` within text blocks, thanks for reporting @krisdigital
 - Handle paragraphs in `li` tags, thanks @gstamp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Rakefile new/Rakefile
--- old/Rakefile        2019-08-22 15:18:56.000000000 +0200
+++ new/Rakefile        2020-01-07 19:15:40.000000000 +0100
@@ -10,5 +10,5 @@
 
 desc 'Open an irb session preloaded with this library'
 task :console do
-  sh 'irb -rubygems -I lib -r reverse_markdown.rb'
+  sh 'irb -I lib -r reverse_markdown.rb'
 end
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/reverse_markdown/cleaner.rb 
new/lib/reverse_markdown/cleaner.rb
--- old/lib/reverse_markdown/cleaner.rb 2019-08-22 15:18:56.000000000 +0200
+++ new/lib/reverse_markdown/cleaner.rb 2020-01-07 19:15:40.000000000 +0100
@@ -59,6 +59,11 @@
       string.gsub(/(\*\*|~~|__)\s([\.!\?'"])/, "\\1".strip + "\\2")
     end
 
+    def force_encoding(string)
+      ReverseMarkdown.config.force_encoding or return string
+      string.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, 
replace: '')
+    end
+
     private
 
     def preserve_border_whitespaces(string, options = {}, &block)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/reverse_markdown/config.rb 
new/lib/reverse_markdown/config.rb
--- old/lib/reverse_markdown/config.rb  2019-08-22 15:18:56.000000000 +0200
+++ new/lib/reverse_markdown/config.rb  2020-01-07 19:15:40.000000000 +0100
@@ -1,10 +1,11 @@
 module ReverseMarkdown
   class Config
-    attr_accessor :unknown_tags, :github_flavored, :tag_border
+    attr_writer :unknown_tags, :github_flavored, :tag_border, :force_encoding
 
     def initialize
       @unknown_tags     = :pass_through
       @github_flavored  = false
+      @force_encoding   = false
       @em_delimiter     = '_'.freeze
       @strong_delimiter = '**'.freeze
       @inline_options   = {}
@@ -29,5 +30,9 @@
     def tag_border
       @inline_options[:tag_border] || @tag_border
     end
+
+    def force_encoding
+      @inline_options[:force_encoding] || @force_encoding
+    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/reverse_markdown/converters/a.rb 
new/lib/reverse_markdown/converters/a.rb
--- old/lib/reverse_markdown/converters/a.rb    2019-08-22 15:18:56.000000000 
+0200
+++ new/lib/reverse_markdown/converters/a.rb    2020-01-07 19:15:40.000000000 
+0100
@@ -6,7 +6,7 @@
         href  = node['href']
         title = extract_title(node)
 
-        if href.to_s.start_with?('#') || href.to_s.empty? || name.empty?
+        if href.to_s.empty? || name.empty?
           name
         else
           link = "[#{name}](#{href}#{title})"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/reverse_markdown/converters/del.rb 
new/lib/reverse_markdown/converters/del.rb
--- old/lib/reverse_markdown/converters/del.rb  2019-08-22 15:18:56.000000000 
+0200
+++ new/lib/reverse_markdown/converters/del.rb  2020-01-07 19:15:40.000000000 
+0100
@@ -20,6 +20,7 @@
     end
 
     register :strike, Del.new
+    register :s,      Del.new
     register :del,    Del.new
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/reverse_markdown/version.rb 
new/lib/reverse_markdown/version.rb
--- old/lib/reverse_markdown/version.rb 2019-08-22 15:18:56.000000000 +0200
+++ new/lib/reverse_markdown/version.rb 2020-01-07 19:15:40.000000000 +0100
@@ -1,3 +1,3 @@
 module ReverseMarkdown
-  VERSION = '1.2.0'
+  VERSION = '1.4.0'
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/reverse_markdown.rb new/lib/reverse_markdown.rb
--- old/lib/reverse_markdown.rb 2019-08-22 15:18:56.000000000 +0200
+++ new/lib/reverse_markdown.rb 2020-01-07 19:15:40.000000000 +0100
@@ -1,4 +1,3 @@
-require 'digest'
 require 'nokogiri'
 require 'reverse_markdown/version'
 require 'reverse_markdown/errors'
@@ -33,15 +32,17 @@
 module ReverseMarkdown
 
   def self.convert(input, options = {})
-    root = case input
-      when String                  then Nokogiri::HTML(input).root
-      when Nokogiri::XML::Document then input.root
-      when Nokogiri::XML::Node     then input
-    end
+    config.with(options) do
+      input = cleaner.force_encoding(input.to_s)
 
-    root or return ''
+      root = case input
+        when String                  then Nokogiri::HTML(input).root
+        when Nokogiri::XML::Document then input.root
+        when Nokogiri::XML::Node     then input
+      end
+
+      root or return ''
 
-    config.with(options) do
       result = ReverseMarkdown::Converters.lookup(root.name).convert(root)
       cleaner.tidy(result)
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2019-08-22 15:18:56.000000000 +0200
+++ new/metadata        2020-01-07 19:15:40.000000000 +0100
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: reverse_markdown
 version: !ruby/object:Gem::Version
-  version: 1.2.0
+  version: 1.4.0
 platform: ruby
 authors:
 - Johannes Opper
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2019-08-22 00:00:00.000000000 Z
+date: 2020-01-07 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: nokogiri
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/reverse_markdown.gemspec new/reverse_markdown.gemspec
--- old/reverse_markdown.gemspec        2019-08-22 15:18:56.000000000 +0200
+++ new/reverse_markdown.gemspec        2020-01-07 19:15:40.000000000 +0100
@@ -11,7 +11,6 @@
   s.summary     = %q{Convert html code into markdown.}
   s.description = %q{Map simple html back into markdown, e.g. if you want to 
import existing html data in your application.}
   s.licenses    = ["WTFPL"]
-  s.rubyforge_project = "reverse_markdown"
 
   s.files         = `git ls-files`.split("\n")
   s.test_files    = `git ls-files -- {test,spec,features}/*`.split("\n")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/components/anchors_spec.rb 
new/spec/components/anchors_spec.rb
--- old/spec/components/anchors_spec.rb 2019-08-22 15:18:56.000000000 +0200
+++ new/spec/components/anchors_spec.rb 2020-01-07 19:15:40.000000000 +0100
@@ -20,7 +20,7 @@
   context "links to ignore" do
     it { is_expected.to include ' ignore anchor tags with no link text ' }
     it { is_expected.to include ' not ignore [![An 
Image](image.png)](foo.html) anchor tags with images' }
-    it { is_expected.to include ' pass through the text of internal jumplinks 
without treating them as links ' }
+    it { is_expected.to include ' pass through the text of [internal 
jumplinks](#content) without treating them as links ' }
     it { is_expected.to include ' pass through the text of anchor tags with no 
href without treating them as links ' }
   end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/lib/reverse_markdown/converters/del_spec.rb 
new/spec/lib/reverse_markdown/converters/del_spec.rb
--- old/spec/lib/reverse_markdown/converters/del_spec.rb        2019-08-22 
15:18:56.000000000 +0200
+++ new/spec/lib/reverse_markdown/converters/del_spec.rb        2020-01-07 
19:15:40.000000000 +0100
@@ -11,6 +11,11 @@
       expect(converter.convert(input)).to eq '~~deldeldel~~'
     end
 
+    it 'converts the input as expected' do
+      input = node_for('<s>strike that</s>')
+      expect(converter.convert(input)).to eq '~~strike that~~'
+    end
+
     it 'skips empty tags' do
       input = node_for('<del></del>')
       expect(converter.convert(input)).to eq ''
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/lib/reverse_markdown_spec.rb 
new/spec/lib/reverse_markdown_spec.rb
--- old/spec/lib/reverse_markdown_spec.rb       2019-08-22 15:18:56.000000000 
+0200
+++ new/spec/lib/reverse_markdown_spec.rb       2020-01-07 19:15:40.000000000 
+0100
@@ -33,5 +33,15 @@
       end
       expect(ReverseMarkdown.config.github_flavored).to eq true
     end
+
+    describe 'force_encoding option', jruby: :exclude do
+      it 'raises invalid byte sequence in UTF-8 exception' do
+        expect { ReverseMarkdown.convert("hi \255") }.to 
raise_error(ArgumentError)
+      end
+
+      it 'handles invalid byte sequence if option is set' do
+        expect(ReverseMarkdown.convert("hi \255", force_encoding: true)).to eq 
"hi\n\n"
+      end
+    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/spec_helper.rb new/spec/spec_helper.rb
--- old/spec/spec_helper.rb     2019-08-22 15:18:56.000000000 +0200
+++ new/spec/spec_helper.rb     2020-01-07 19:15:40.000000000 +0100
@@ -14,6 +14,14 @@
   config.after(:each) do
     ReverseMarkdown.instance_variable_set(:@config, nil)
   end
+
+  config.around(jruby: :exclude) do |example|
+    if RUBY_ENGINE == 'jruby'
+      example.metadata[:skip] = true
+    else
+      example.call
+    end
+  end
 end
 
 def node_for(html)


Reply via email to