pxg 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/pxg.rb +4 -2
- metadata +1 -1
data/lib/pxg.rb
CHANGED
@@ -8,7 +8,7 @@ require 'json'
|
|
8
8
|
|
9
9
|
class Pxg
|
10
10
|
|
11
|
-
VERSION = '1.1.
|
11
|
+
VERSION = '1.1.4'
|
12
12
|
|
13
13
|
def reimage(argv)
|
14
14
|
xml = argv[0]
|
@@ -62,7 +62,9 @@ class Pxg
|
|
62
62
|
end#if
|
63
63
|
else # not image attachment
|
64
64
|
corrections.each do |oldid, newid|
|
65
|
-
|
65
|
+
regex_str = "<wp:meta_key>_thumbnail_id<\/wp:meta_key>\\s*<wp:meta_value><\\!\\[CDATA\\[#{oldid}\\]\\]></wp:meta_value>"
|
66
|
+
search_regex = Regexp.new regex_str
|
67
|
+
itemstr = itemstr.sub search_regex, "<wp:meta_key>_thumbnail_id</wp:meta_key>\n\t\t\t<wp:meta_value><![CDATA[#{newid}]]></wp:meta_value>"
|
66
68
|
end#each
|
67
69
|
itemstr = itemstr + '</item>'
|
68
70
|
end#if
|