texta 0.2.0 → 0.2.1
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/Rakefile +1 -1
- data/lib/texta.rb +41 -3
- data/texta.gemspec +1 -1
- metadata +1 -1
data/Rakefile
CHANGED
data/lib/texta.rb
CHANGED
@@ -52,7 +52,7 @@ module Texta
|
|
52
52
|
|
53
53
|
def process(node)
|
54
54
|
case node.name
|
55
|
-
when "meta", "link"
|
55
|
+
when "meta", "link", "style"
|
56
56
|
""
|
57
57
|
|
58
58
|
# bold
|
@@ -71,6 +71,7 @@ module Texta
|
|
71
71
|
|
72
72
|
# links
|
73
73
|
when "a"
|
74
|
+
return ""
|
74
75
|
return "" unless node["href"]
|
75
76
|
"[" + children(node).join(" ") + "]" + "(" + node["href"] + ")"
|
76
77
|
|
@@ -291,8 +292,8 @@ HTML
|
|
291
292
|
|
292
293
|
def test_link
|
293
294
|
input = "<a href='http://google.com'>Link</a>"
|
294
|
-
html = '
|
295
|
-
text = "
|
295
|
+
html = ''
|
296
|
+
text = ""
|
296
297
|
assert_testa input, text, html
|
297
298
|
end
|
298
299
|
|
@@ -307,4 +308,41 @@ HTML
|
|
307
308
|
input = "<img src='http://x/y/z.jpg' />"
|
308
309
|
assert_testa input, "", ""
|
309
310
|
end
|
311
|
+
|
312
|
+
def test_complicated
|
313
|
+
input = <<-TEXT
|
314
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
315
|
+
<meta content="Word.Document" name="ProgId" />
|
316
|
+
<meta content="Microsoft Word 12" name="Generator" />
|
317
|
+
<meta content="Microsoft Word 12" name="Originator" />
|
318
|
+
<div style="TEXT-ALIGN: justify" align="justify">
|
319
|
+
<link href="file:///C:%5CUsers%5CStefan%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List" />
|
320
|
+
<link href="file:///C:%5CUsers%5CStefan%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData" />
|
321
|
+
<link href="file:///C:%5CUsers%5CStefan%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping" />
|
322
|
+
<style type="text/css"> <!-- /* Font Definitions */ @font-face {"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4;} @font-face {"Arial Unicode MS"; panose-1:2 11 6 4 2 2 2 2 2 4;} @font-face { panose-1:2 15 5 2 2 2 4 3 2 4;} @font-face {"\@Arial Unicode MS"; panose-1:2 11 6 4 2 2 2 2 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal { mso-style-parent:""; margin-top:12.0pt; margin-right:0cm; margin-bottom:0cm; margin-left:0cm; margin-bottom:.0001pt; line-height:5%; font-size:11.0pt;"Calibri","sans-serif"; mso-bidi-"Times New Roman";} .MsoChpDefault { mso-bidi-"Times New Roman";} .MsoPapDefault { margin-top:12.0pt; line-height:5%;} @page Section1 {size:595.3pt 841.9pt; margin:70.85pt 70.85pt 2.0cm 70.85pt;} div.Section1 {page:Section1;} --></style>
|
323
|
+
<span style="FONT-FAMILY: Arial">Das T-Shirt „Che“ der Streetwear Marke Exact Science ist eine Hommage an den Revolutionär Che Guevara. Tausende T-Shirts wurden bereits mit seinem Abbild gedruckt, doch keines traf bisher unseren Geschmack so wie das T-Shirt „Che“ von Exact Science.Genauso revolutionär wie Che‘s Unabhängigkeitsbewegung, gestaltet auch Exact Science ihre Motive und gelten deshalb als Vorreiter der T-Shirt Zunft. Die Perfekte Kombination aus Kunst und Geschichte. urban-stylistics sagt: „Danke“</span> <br style="FONT-FAMILY: Arial" /><span style="FONT-FAMILY: Arial">Unser Model ist 184 cm groß und trägt die Größe M.</span><br style="FONT-FAMILY: Arial" /></div>
|
324
|
+
<p align="justify"><span style="FONT-FAMILY: Arial">100 % Baumwolle</span><br /><br /><a href="http://www.urban-stylistics.com/Marken-Mann/Exact-Science:::47_37.html" target="_self"><img height="67" alt="" src="/images/Logos Marken/xs_logo.gif" width="67" /></a></p>
|
325
|
+
TEXT
|
326
|
+
|
327
|
+
text = <<-TEXT
|
328
|
+
Das T-Shirt „Che“ der Streetwear Marke Exact Science ist eine Hommage an den Revolutionär Che Guevara. Tausende T-Shirts wurden bereits mit seinem Abbild gedruckt, doch keines traf bisher unseren Geschmack so wie das T-Shirt „Che“ von Exact Science.Genauso revolutionär wie Che‘s Unabhängigkeitsbewegung, gestaltet auch Exact Science ihre Motive und gelten deshalb als Vorreiter der T-Shirt Zunft. Die Perfekte Kombination aus Kunst und Geschichte. urban-stylistics sagt: „Danke“
|
329
|
+
Unser Model ist 184 cm groß und trägt die Größe M.
|
330
|
+
|
331
|
+
|
332
|
+
100 % Baumwolle
|
333
|
+
|
334
|
+
|
335
|
+
TEXT
|
336
|
+
|
337
|
+
html = <<-HTML
|
338
|
+
<pre><code>Das T-Shirt &bdquo;Che&ldquo; der Streetwear Marke Exact Science ist eine Hommage an den Revolution&auml;r Che Guevara. Tausende T-Shirts wurden bereits mit seinem Abbild gedruckt, doch keines traf bisher unseren Geschmack so wie das T-Shirt &bdquo;Che&ldquo; von Exact Science.Genauso revolution&auml;r wie Che&lsquo;s Unabh&auml;ngigkeitsbewegung, gestaltet auch Exact Science ihre Motive und gelten deshalb als Vorreiter der T-Shirt Zunft. Die Perfekte Kombination aus Kunst und Geschichte. urban-stylistics sagt: &bdquo;Danke&ldquo;
|
339
|
+
</code></pre>
|
340
|
+
|
341
|
+
<p> Unser Model ist 184 cm groß und trägt die Größe M.</p>
|
342
|
+
|
343
|
+
<p>100 % Baumwolle</p>
|
344
|
+
HTML
|
345
|
+
|
346
|
+
assert_testa input, text, html
|
347
|
+
end
|
310
348
|
end
|
data/texta.gemspec
CHANGED