Hello community,

here is the log from the commit of package python3-html2text for 
openSUSE:Factory checked in at 2015-04-15 16:24:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-html2text (Old)
 and      /work/SRC/openSUSE:Factory/.python3-html2text.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python3-html2text"

Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-html2text/python3-html2text.changes      
2015-02-20 12:01:56.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python3-html2text.new/python3-html2text.changes 
2015-04-15 16:24:59.000000000 +0200
@@ -1,0 +2,14 @@
+Tue Apr 14 22:48:37 UTC 2015 - [email protected]
+
+- update to version 2015.4.14:
+  * Feature #59: Write image tags with height and width attrs as raw html to 
retain dimensions
+
+-------------------------------------------------------------------
+Tue Apr 14 04:19:18 UTC 2015 - [email protected]
+
+- update to version 2015.4.13:
+  * Feature #56: Treat '-' file parameter as stdin.
+  * Feature #57: Retain escaping of html except within code or pre
+    tags.
+
+-------------------------------------------------------------------

Old:
----
  html2text-2015.2.18.tar.gz

New:
----
  html2text-2015.4.14.tar.gz

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

Other differences:
------------------
++++++ python3-html2text.spec ++++++
--- /var/tmp/diff_new_pack.cjBpp5/_old  2015-04-15 16:25:00.000000000 +0200
+++ /var/tmp/diff_new_pack.cjBpp5/_new  2015-04-15 16:25:00.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           python3-html2text
-Version:        2015.2.18
+Version:        2015.4.14
 Release:        0
 Url:            https://github.com/Alir3z4/html2text/
 Summary:        Turn HTML into equivalent Markdown-structured text

++++++ html2text-2015.2.18.tar.gz -> html2text-2015.4.14.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/html2text-2015.2.18/AUTHORS.rst 
new/html2text-2015.4.14/AUTHORS.rst
--- old/html2text-2015.2.18/AUTHORS.rst 2015-02-18 14:16:15.000000000 +0100
+++ new/html2text-2015.4.14/AUTHORS.rst 2015-04-13 17:48:22.000000000 +0200
@@ -12,6 +12,9 @@
 * Jocelyn Delalande <[email protected]>
 * Matt Dorn <[email protected]>
 * Miguel Tavares <[email protected]>
+* Scott Blackburn <[email protected]>
+* Peter Wu <[email protected]>
+
 
 Maintainer:
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/html2text-2015.2.18/ChangeLog.rst 
new/html2text-2015.4.14/ChangeLog.rst
--- old/html2text-2015.2.18/ChangeLog.rst       2015-02-18 14:20:44.000000000 
+0100
+++ new/html2text-2015.4.14/ChangeLog.rst       2015-04-14 19:05:05.000000000 
+0200
@@ -1,3 +1,20 @@
+2015.4.14
+=========
+----
+
+
+* Feature #59: Write image tags with height and width attrs as raw html to 
retain dimensions
+
+
+2015.4.13
+=========
+----
+
+
+* Feature #56: Treat '-' file parameter as stdin.
+* Feature #57: Retain escaping of html except within code or pre tags.
+
+
 2015.2.18
 ==========
 ----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/html2text-2015.2.18/PKG-INFO 
new/html2text-2015.4.14/PKG-INFO
--- old/html2text-2015.2.18/PKG-INFO    2015-02-18 14:23:58.000000000 +0100
+++ new/html2text-2015.4.14/PKG-INFO    2015-04-14 19:09:30.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: html2text
-Version: 2015.2.18
+Version: 2015.4.14
 Summary: Turn HTML into equivalent Markdown-structured text.
 Home-page: https://github.com/Alir3z4/html2text/
 Author: Alireza Savand
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/html2text-2015.2.18/README.md 
new/html2text-2015.4.14/README.md
--- old/html2text-2015.2.18/README.md   2015-02-18 14:16:15.000000000 +0100
+++ new/html2text-2015.4.14/README.md   2015-04-14 19:05:05.000000000 +0200
@@ -16,14 +16,15 @@
 Usage: `html2text [(filename|url) [encoding]]`
 
 
-| Option                                                 | Description         
   
+| Option                                                 | Description
 
|--------------------------------------------------------|---------------------------------------------------
-| `--version`                                            | Show program's 
version number and exit 
-| `-h`, `--help`                                         | Show this help 
message and exit      
+| `--version`                                            | Show program's 
version number and exit
+| `-h`, `--help`                                         | Show this help 
message and exit
 | `--ignore-links`                                       | Don't include any 
formatting for links
 |`--protect-links`                                       | Protect links from 
line breaks surrounding them "+" with angle brackets
 |`--ignore-images`                                       | Don't include any 
formatting for images
 |`--images-to-alt`                                       | Discard image data, 
only keep alt text
+|`--images-with-size`                                    | Write image tags 
with height and width attrs as raw html to retain dimensions
 |`-g`, `--google-doc`                                    | Convert an 
html-exported Google Document
 |`-d`, `--dash-unordered-list`                           | Use a dash rather 
than a star for unordered list items
 |`-b` `BODY_WIDTH`, `--body-width`=`BODY_WIDTH`          | Number of 
characters per output line, `0` for no wrap
@@ -48,7 +49,7 @@
 Or with some configuration options:
 ```
 >>> import html2text
->>> 
+>>>
 >>> h = html2text.HTML2Text()
 >>> # Ignore converting links from HTML
 >>> h.ignore_links = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/html2text-2015.2.18/html2text/__init__.py 
new/html2text-2015.4.14/html2text/__init__.py
--- old/html2text-2015.2.18/html2text/__init__.py       2015-02-18 
14:16:15.000000000 +0100
+++ new/html2text-2015.4.14/html2text/__init__.py       2015-04-14 
19:09:03.000000000 +0200
@@ -3,6 +3,7 @@
 """html2text: Turn HTML into equivalent Markdown-structured text."""
 from __future__ import division
 import re
+import cgi
 
 try:
     from textwrap import wrap
@@ -28,7 +29,7 @@
     skipwrap
 )
 
-__version__ = "2014.12.29"
+__version__ = "2015.4.14"
 
 
 # TODO:
@@ -60,6 +61,7 @@
         self.ignore_links = config.IGNORE_ANCHORS
         self.ignore_images = config.IGNORE_IMAGES
         self.images_to_alt = config.IMAGES_TO_ALT
+        self.images_with_size = config.IMAGES_WITH_SIZE
         self.ignore_emphasis = config.IGNORE_EMPHASIS
         self.bypass_tables = config.BYPASS_TABLES
         self.google_doc = False
@@ -160,10 +162,16 @@
         return outtext
 
     def handle_charref(self, c):
-        self.o(self.charref(c), 1)
+        charref = self.charref(c)
+        if not self.code and not self.pre:
+            charref = cgi.escape(charref)
+        self.o(charref, 1)
 
     def handle_entityref(self, c):
-        self.o(self.entityref(c), 1)
+        entityref = self.entityref(c)
+        if not self.code and not self.pre and entityref != 
'&nbsp_place_holder;':
+            entityref = cgi.escape(entityref)
+        self.o(entityref, 1)
 
     def handle_starttag(self, tag, attrs):
         self.handle_tag(tag, attrs, 1)
@@ -351,6 +359,7 @@
 
         if tag in ["code", "tt"] and not self.pre:
             self.o('`')  # TODO: `` `this` ``
+            self.code = not self.code
         if tag == "abbr":
             if start:
                 self.abbr_title = None
@@ -405,6 +414,20 @@
                     attrs['href'] = attrs['src']
                 alt = attrs.get('alt') or ''
 
+                # If we have images_with_size, write raw html including width,
+                # height, and alt attributes
+                if self.images_with_size and \
+                        ("width" in attrs or "height" in attrs):
+                    self.o("<img src='" + attrs["src"] + "' ")
+                    if "width" in attrs:
+                        self.o("width='" + attrs["width"] + "' ")
+                    if "height" in attrs:
+                        self.o("height='" + attrs["height"] + "' ")
+                    if alt:
+                        self.o("alt='" + alt + "' ")
+                    self.o("/>")
+                    return
+
                 # If we have a link to create, output the start
                 if not self.maybe_automatic_link is None:
                     href = self.maybe_automatic_link
@@ -416,7 +439,7 @@
                     else:
                         self.o("[")
                         self.maybe_automatic_link = None
-                        self.empty_link = False                   
+                        self.empty_link = False
 
                 # If we have images_to_alt, we discard the image itself,
                 # considering only the alt text.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/html2text-2015.2.18/html2text/cli.py 
new/html2text-2015.4.14/html2text/cli.py
--- old/html2text-2015.2.18/html2text/cli.py    2015-02-18 14:16:15.000000000 
+0100
+++ new/html2text-2015.4.14/html2text/cli.py    2015-04-14 19:05:05.000000000 
+0200
@@ -45,6 +45,14 @@
         help="Discard image data, only keep alt text"
     )
     p.add_option(
+        "--images-with-size",
+        dest="images_with_size",
+        action="store_true",
+        default=config.IMAGES_WITH_SIZE,
+        help="Write image tags with height and width attrs as raw html to "
+             "retain dimensions"
+    )
+    p.add_option(
         "-g", "--google-doc",
         action="store_true",
         dest="google_doc",
@@ -118,7 +126,7 @@
 
     # process input
     encoding = "utf-8"
-    if len(args) > 0:
+    if len(args) > 0 and args[0] != '-':
         file_ = args[0]
         if len(args) == 2:
             encoding = args[1]
@@ -166,6 +174,7 @@
     h.protect_links = options.protect_links
     h.ignore_images = options.ignore_images
     h.images_to_alt = options.images_to_alt
+    h.images_with_size = options.images_with_size
     h.google_doc = options.google_doc
     h.hide_strikethrough = options.hide_strikethrough
     h.escape_snob = options.escape_snob
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/html2text-2015.2.18/html2text/config.py 
new/html2text-2015.4.14/html2text/config.py
--- old/html2text-2015.2.18/html2text/config.py 2015-02-18 14:16:15.000000000 
+0100
+++ new/html2text-2015.4.14/html2text/config.py 2015-04-14 19:05:05.000000000 
+0200
@@ -30,6 +30,7 @@
 IGNORE_ANCHORS = False
 IGNORE_IMAGES = False
 IMAGES_TO_ALT = False
+IMAGES_WITH_SIZE = False
 IGNORE_EMPHASIS = False
 
 # For checking space-only lines on line 771
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/html2text-2015.2.18/html2text.egg-info/PKG-INFO 
new/html2text-2015.4.14/html2text.egg-info/PKG-INFO
--- old/html2text-2015.2.18/html2text.egg-info/PKG-INFO 2015-02-18 
14:23:58.000000000 +0100
+++ new/html2text-2015.4.14/html2text.egg-info/PKG-INFO 2015-04-14 
19:09:30.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: html2text
-Version: 2015.2.18
+Version: 2015.4.14
 Summary: Turn HTML into equivalent Markdown-structured text.
 Home-page: https://github.com/Alir3z4/html2text/
 Author: Alireza Savand
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/html2text-2015.2.18/html2text.egg-info/SOURCES.txt 
new/html2text-2015.4.14/html2text.egg-info/SOURCES.txt
--- old/html2text-2015.2.18/html2text.egg-info/SOURCES.txt      2015-02-18 
14:23:58.000000000 +0100
+++ new/html2text-2015.4.14/html2text.egg-info/SOURCES.txt      2015-04-14 
19:09:30.000000000 +0200
@@ -35,8 +35,12 @@
 test/emdash-para.md
 test/empty-link.html
 test/empty-link.md
+test/html-escaping.html
+test/html-escaping.md
 test/images_to_alt.html
 test/images_to_alt.md
+test/images_with_size.html
+test/images_with_size.md
 test/img-tag-with-link.html
 test/img-tag-with-link.md
 test/invalid_start.html
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/html2text-2015.2.18/setup.py 
new/html2text-2015.4.14/setup.py
--- old/html2text-2015.2.18/setup.py    2015-02-18 14:20:44.000000000 +0100
+++ new/html2text-2015.4.14/setup.py    2015-04-14 19:08:44.000000000 +0200
@@ -34,7 +34,7 @@
 
 setup(
     name="html2text",
-    version="2015.2.18",
+    version="2015.4.14",
     description="Turn HTML into equivalent Markdown-structured text.",
     author="Aaron Swartz",
     author_email="[email protected]",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/html2text-2015.2.18/test/html-escaping.html 
new/html2text-2015.4.14/test/html-escaping.html
--- old/html2text-2015.2.18/test/html-escaping.html     1970-01-01 
01:00:00.000000000 +0100
+++ new/html2text-2015.4.14/test/html-escaping.html     2015-04-13 
17:28:02.000000000 +0200
@@ -0,0 +1,3 @@
+<p>Escaped HTML like &lt;div&gt; or &amp; should remain escaped on output</p>
+<pre>...unless that escaped HTML is in a &lt;pre&gt; tag</pre>
+<code>...or a &lt;code&gt; tag</code>
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/html2text-2015.2.18/test/html-escaping.md 
new/html2text-2015.4.14/test/html-escaping.md
--- old/html2text-2015.2.18/test/html-escaping.md       1970-01-01 
01:00:00.000000000 +0100
+++ new/html2text-2015.4.14/test/html-escaping.md       2015-04-13 
17:28:02.000000000 +0200
@@ -0,0 +1,8 @@
+Escaped HTML like &lt;div&gt; or &amp; should remain escaped on output
+
+    
+    
+    ...unless that escaped HTML is in a <pre> tag
+
+`...or a <code> tag`
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/html2text-2015.2.18/test/images_with_size.html 
new/html2text-2015.4.14/test/images_with_size.html
--- old/html2text-2015.2.18/test/images_with_size.html  1970-01-01 
01:00:00.000000000 +0100
+++ new/html2text-2015.4.14/test/images_with_size.html  2015-04-14 
19:05:05.000000000 +0200
@@ -0,0 +1,7 @@
+<img src='image_without_dimensions.jpg' alt='An image without dimensions' 
style='ignored-style' />
+
+<img src='image_with_width.jpg' alt='An image with a width attr' width='300' 
data-ignored='ignored data' />
+
+<img src='image_with_width.jpg' alt='An image with a height attr' height='300' 
data-ignored='ignored data' />
+
+<img src='image_with_width_and_height.jpg' alt='An image with width and 
height' width='300' height='300' id='ignored-id' />
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/html2text-2015.2.18/test/images_with_size.md 
new/html2text-2015.4.14/test/images_with_size.md
--- old/html2text-2015.2.18/test/images_with_size.md    1970-01-01 
01:00:00.000000000 +0100
+++ new/html2text-2015.4.14/test/images_with_size.md    2015-04-14 
19:05:05.000000000 +0200
@@ -0,0 +1,6 @@
+![An image without dimensions](image_without_dimensions.jpg) <img
+src='image_with_width.jpg' width='300' alt='An image with a width attr' />
+<img src='image_with_width.jpg' height='300' alt='An image with a height attr'
+/> <img src='image_with_width_and_height.jpg' width='300' height='300' alt='An
+image with width and height' />
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/html2text-2015.2.18/test/test_html2text.py 
new/html2text-2015.4.14/test/test_html2text.py
--- old/html2text-2015.2.18/test/test_html2text.py      2015-02-18 
14:16:15.000000000 +0100
+++ new/html2text-2015.4.14/test/test_html2text.py      2015-04-14 
19:05:05.000000000 +0200
@@ -135,6 +135,10 @@
         module_args['images_to_alt'] = True
         cmdline_args.append('--images-to-alt')
 
+    if base_fn.startswith('images_with_size'):
+        module_args['images_with_size'] = True
+        cmdline_args.append('--images-with-size')
+
     if base_fn.startswith('single_line_break'):
         module_args['body_width'] = 0
         cmdline_args.append('--body-width=0')


Reply via email to