Clean <input>,<textarea>,<select>,<button> elements

pull/336/head
andrei-ch 8 years ago committed by Gijs
parent a34d054f45
commit c5ff44d8fe

@ -470,6 +470,7 @@ Readability.prototype = {
// Clean out junk from the article content
this._cleanConditionally(articleContent, "form");
this._cleanConditionally(articleContent, "fieldset");
this._clean(articleContent, "object");
this._clean(articleContent, "embed");
this._clean(articleContent, "h1");
@ -487,6 +488,10 @@ Readability.prototype = {
this._clean(articleContent, "h2");
this._clean(articleContent, "iframe");
this._clean(articleContent, "input");
this._clean(articleContent, "textarea");
this._clean(articleContent, "select");
this._clean(articleContent, "button");
this._cleanHeaders(articleContent);
// Do these last as the previous stuff may have removed junk
@ -1710,7 +1715,7 @@ Readability.prototype = {
(img > p && !this._hasAncestorTag(node, "figure")) ||
(!isList && li > p) ||
(input > Math.floor(p/3)) ||
(!isList && contentLength < 25 && (img === 0 || img > 2)) ||
(!isList && contentLength < 25 && (img === 0 || img > 2) && !this._hasAncestorTag(node, "figure")) ||
(!isList && weight < 25 && linkDensity > 0.2) ||
(weight >= 25 && linkDensity > 0.5) ||
((embedCount === 1 && contentLength < 75) || embedCount > 1);

@ -22,12 +22,7 @@
<div class="customizer-copy">
<h3>Themes</h3>
<p class="lead">Make Firefox match your style. Choose from thousands of themes and dress up your browser with a single click.</p>
<p id="themes-thumbs">
<button type="button" aria-controls="theme-demo" id="theme-yellow">Preview yellow theme</button>
<button type="button" aria-controls="theme-demo" id="theme-green">Preview green theme</button>
<button type="button" aria-controls="theme-demo" id="theme-blue">Preview blue theme</button>
<button type="button" aria-controls="theme-demo" id="theme-red" class="selected">Preview red theme</button>
</p><a class="more" rel="external" href="https://addons.mozilla.org/firefox/themes/">Try it now</a>
<a class="more" rel="external" href="https://addons.mozilla.org/firefox/themes/">Try it now</a>
<br/><a class="more" rel="external" href="https://support.mozilla.org/kb/use-themes-change-look-of-firefox">Learn more</a></div><a class="next show-customizer" href="#add-ons" role="button">Next</a>
<div class="customizer-visual"><img id="theme-demo" src="http://mozorg.cdn.mozilla.net/media/img/firefox/desktop/customize/theme-red.61611c5734ab.png" alt="Preview of the currently selected theme"/></div>
</div>
@ -57,4 +52,4 @@
</div>
<section id="sync" class="ga-section" data-ga-label="Keep your Firefox in Sync"> </section>
</div>
</div>
</div>

@ -1,6 +1,7 @@
{
"title": "These are the 8 coolest PlayStation VR games",
"byline": "Ben Silverman",
"dir": null,
"excerpt": "To help you decide whats what, Ive put together this list of the 8 PSVR games worth considering. Beloved cult hit “Rez” gets the VR treatment to help launch the PSVR, and the results are terrific. Chaos, for sure, and also “Thumper.” Called a “violent rhythm game” by its creators, “Thumper” is, well",
"readerable": true
}

@ -6,7 +6,8 @@
<div class="Ov(h) Pos(r) Mah(80px)" data-reactid="413">
<figcaption class="C(#787d82) Fz(13px) Py(5px) Lh(1.5)" title="Sonys PlayStation VR." data-reactid="414">
<p class="figure-caption" data-reactid="415">Sonys PlayStation VR.</p>
</figcaption><button class="C(#157cfb) Cur(p) W(100%) T(63px) Bgc(#fff) Ta(start) Fz(13px) P(0) Bd(0) O(0) Lh(1.5) Pos(a)" data-reactid="416"><span data-reactid="417">More</span></button></div>
</figcaption>
</div>
</figure>
<div class="canvas-body C(#26282a) Wow(bw) Cl(start) Mb(20px) Fz(15px) Lh(1.6) Ff($ff-secondary)" data-reactid="418">
<p class="canvas-text Mb(1.0em) Mb(0)--sm Mt(0.8em)--sm canvas-atom" data-type="text" data-reactid="419">Virtual reality has officially reached the consoles. And its pretty good! <a href="http://finance.yahoo.com/news/review-playstation-vr-is-comfortable-and-affordable-but-lacks-must-have-games-165053851.html">Sonys PlayStation VR</a> is extremely comfortable and reasonably priced, and while its lacking killer apps, its loaded with lots of interesting ones.</p>
@ -47,4 +48,4 @@
<a href="https://twitter.com/ben_silverman" target="_blank" rel="nofollow noopener noreferrer"> <i>ben_silverman</i></a><i>.</i></p>
</div>
</article><span class="canvas-bottom-anchor-80b35014-fba3-377e-adc5-47fb44f61fa7" aria-hidden="true" data-reactid="462"></span></div>
</div>
</div>

@ -9,7 +9,7 @@
<div>
<p class="slideshow-description">In this photo dated Tuesday, Nov, 29, 2016 the Soyuz-FG rocket booster with the Progress MS-04 cargo ship is installed on a launch pad in Baikonur, Kazakhstan. The unmanned Russian cargo space ship Progress MS-04 broke up in the atmosphere over Siberia on Thursday Dec. 1, 2016, just minutes after the launch en route to the International Space Station due to an unspecified malfunction, the Russian space agency said.(Oleg Urusov/ Roscosmos Space Agency Press Service photo via AP)</p>
</div>
</div><button class="C(#157cfb) Cur(p) W(100%) Ta(start) Fz(13px) P(0) Bd(0) O(0) O(n):f"><span>More</span></button></div>
</div></div>
</div>
</div>
<div class="canvas-body C(#26282a) Wow(bw) Cl(start) Mb(20px) Fz(15px) Lh(1.6) Ff($ff-secondary)">

@ -1,6 +1,7 @@
{
"title": "Veteran Wraps Baby in American Flag, Photo Sparks Controversy",
"byline": "By GILLIAN MOHNEY\n March 11, 2015 3:46 PM",
"dir": "ltr",
"excerpt": "From Yahoo: A photographer and Navy veteran is fighting back after a photo she posted to Facebook started an online backlash. Vanessa Hicks said she had no idea her photo would be considered controversial. The photo, from a military familys newborn photo shoot, showed a newborn infant wrapped in an American flag held by his father, who was in his military uniform. Hicks, a Navy veteran herself and the wife of an active-duty Navy member, said her intention was to honor the flag as well as her clients, who wanted to incorporate their military service in the photo shoot.",
"readerable": true
}

@ -19,22 +19,24 @@
<p><a href="http://abcnews.go.com/Travel/video/antarctica-penguin-post-office-job-attracts-record-number-29247380" target="_blank" data-rapid_p="16">Antarctica 'Penguin Post Office' Attracts Record Number of Applicants</a></p>
<p>“This is what he was fighting for, his son wrapped in an American flag,” Hicks told ABC News. However, when she posted the image on her page, she started to get comments accusing her of desecrating the flag.</p>
<p>On one Facebook page an unidentified poster put up her picture writing and wrote they found it was “disrespectful, rude, tacky, disgusting, and against the U.S. Flag Code.”</p>
<div class="yom-fig-frame"><span id="schemaorg"><div class="yom-figure yom-fig-middle"><figure class="cover get-lbdata-from-dom go-to-slideshow-lightbox" data-orig-index="2"> <a class="cover-anchor" name="cover-c9b69c1a26e19ae9fe744763dc31e9ac" id="cover-c9b69c1a26e19ae9fe744763dc31e9ac" data-rapid_p="17"></a><img alt="Vanessa Hicks" class="editorial lzbg" data-preembed="image" src="https://s3.yimg.com/bt/api/res/1.2/GNtA09EDJWzWfpBzGYJS0Q--/YXBwaWQ9eW5ld3NfbGVnbztxPTg1O3c9NjMw/http://media.zenfs.com/en_us/gma/us.abcnews.gma.com/HT_flag_baby_jtm_150311_16x9_992.jpg" title="Vanessa Hicks" width="630"/></figure><p class="legend">Vanessa Hicks</p></div>
</span></div>
<p style="display: inline;" class="readability-styled">The Federal Flag Code has guidelines for the proper treatment of the U.S. Flag but there are no rules for punishment related to violations. In the past, the </p><a href="http://abcnews.go.com/topics/news/us/supreme-court.htm" target="_blank" data-rapid_p="18">Supreme Court</a>
<p style="display: inline;" class="readability-styled"> has found that people are protected from punishment under the First Amendment for manipulating or even burning the flag.
</p>
<p>Hicks said she was surprised when messages suddenly started to pop up on her Facebook page and even her own website criticizing her photos.</p>
<p>She said she stayed up until 4 a.m. recently to take down comments from her business and company page, even on shoots that had nothing to do with the flag.</p>
<p>“I know how low I felt during those first few hours,” said Hicks. “[I felt] am I not a good American or veteran or wife. Its a train-wreck you cant help but watch.”</p>
<p>As Hicks tried to stop the comments from taking over her pages, others started to take notice and her picture went viral on social media sites. After that, Hicks found that many people, both military and civilian, told her they did not find the picture offensive.</p>
<p>“I have seen first-hand what is desecration of the flag,” Hicks said of her time in the military. “At the end of the day I didnt do anything that disrespected this flag.”</p>
<p>Hicks, whose husband is still on active duty in the Navy, said the flag is a symbol of U.S. freedoms including the First Amendment right to free speech.</p>
<p>“[My husband] wouldnt die for a flag, he would die for the freedoms that this country offers,” she told ABC News.</p>
<p>After her story grabbed local headlines, Hicks has been inundated by requests for photos shoots, and she said she plans to give 15 percent of all profits related to these shoots to the USO.</p>
<div class="yom-fig-frame"><span id="schemaorg"><div class="yom-figure yom-fig-middle"><figure class="cover get-lbdata-from-dom go-to-slideshow-lightbox" data-orig-index="2"> <a class="cover-anchor" name="cover-c9b69c1a26e19ae9fe744763dc31e9ac" id="cover-c9b69c1a26e19ae9fe744763dc31e9ac" data-rapid_p="17"></a><div class="cta-overlay"><span class="clearfix title cta-text medium"></span>
<p class="cta-text large">View photo</p><span class="icon-slideshow icon-white-slideshow">.</span></div><img alt="Vanessa Hicks" class="editorial lzbg" data-preembed="image" src="https://s3.yimg.com/bt/api/res/1.2/GNtA09EDJWzWfpBzGYJS0Q--/YXBwaWQ9eW5ld3NfbGVnbztxPTg1O3c9NjMw/http://media.zenfs.com/en_us/gma/us.abcnews.gma.com/HT_flag_baby_jtm_150311_16x9_992.jpg" title="Vanessa Hicks" width="630" /></figure>
<p class="legend">Vanessa Hicks</p>
</div>
</span>
</div>
</section>
<p style="display: inline;" class="readability-styled">The Federal Flag Code has guidelines for the proper treatment of the U.S. Flag but there are no rules for punishment related to violations. In the past, the </p><a href="http://abcnews.go.com/topics/news/us/supreme-court.htm" target="_blank" data-rapid_p="18">Supreme Court</a>
<p style="display: inline;" class="readability-styled"> has found that people are protected from punishment under the First Amendment for manipulating or even burning the flag. </p>
<p>Hicks said she was surprised when messages suddenly started to pop up on her Facebook page and even her own website criticizing her photos.</p>
<p>She said she stayed up until 4 a.m. recently to take down comments from her business and company page, even on shoots that had nothing to do with the flag.</p>
<p>“I know how low I felt during those first few hours,” said Hicks. “[I felt] am I not a good American or veteran or wife. Its a train-wreck you cant help but watch.”</p>
<p>As Hicks tried to stop the comments from taking over her pages, others started to take notice and her picture went viral on social media sites. After that, Hicks found that many people, both military and civilian, told her they did not find the picture offensive.</p>
<p>“I have seen first-hand what is desecration of the flag,” Hicks said of her time in the military. “At the end of the day I didnt do anything that disrespected this flag.”</p>
<p>Hicks, whose husband is still on active duty in the Navy, said the flag is a symbol of U.S. freedoms including the First Amendment right to free speech.</p>
<p>“[My husband] wouldnt die for a flag, he would die for the freedoms that this country offers,” she told ABC News.</p>
<p>After her story grabbed local headlines, Hicks has been inundated by requests for photos shoots, and she said she plans to give 15 percent of all profits related to these shoots to the USO.</p>
</div>
</div>
</section>
</div>
</div>
Loading…
Cancel
Save