[kdepim] [Bug 44880] would like to be able to strip tags from html messages
https://bugs.kde.org/show_bug.cgi?id=44880 Laurent Montel mon...@kde.org changed: What|Removed |Added Resolution|--- |FIXED Latest Commit||http://commits.kde.org/kdep ||im/a291bd83397eb74d3a2dde3a ||5d04ba00b6190d7a Version Fixed In||14.12.1 Status|CONFIRMED |RESOLVED --- Comment #22 from Laurent Montel mon...@kde.org --- Git commit a291bd83397eb74d3a2dde3a5d04ba00b6190d7a by Montel Laurent. Committed on 06/01/2015 at 07:03. Pushed by mlaurent into branch 'KDE/4.14'. Fix Bug 44880 - would like to be able to strip tags from html messages FIXED-IN: 14.12.1 M +15 -6messageviewer/viewer/objecttreeparser.cpp http://commits.kde.org/kdepim/a291bd83397eb74d3a2dde3a5d04ba00b6190d7a -- You are receiving this mail because: You are the assignee for the bug. Make the world a better place. Donate to our year end fundraiser https://www.kde.org/fundraisers/yearend2014/ ___ Kdepim-bugs mailing list Kdepim-bugs@kde.org https://mail.kde.org/mailman/listinfo/kdepim-bugs
[kdepim] [Bug 44880] would like to be able to strip tags from html messages
https://bugs.kde.org/show_bug.cgi?id=44880 Kevin Funk kf...@kde.org changed: What|Removed |Added CC||kf...@kde.org -- You are receiving this mail because: You are the assignee for the bug. ___ Kdepim-bugs mailing list Kdepim-bugs@kde.org https://mail.kde.org/mailman/listinfo/kdepim-bugs
[Bug 44880] would like to be able to strip tags from html messages
https://bugs.kde.org/show_bug.cgi?id=44880 --- Comment #21 from Christian Schmitz list schweb com ar 2011-08-15 13:03:02 --- Torgny, my script is located into /home/user/bin I configure a filter rule: All email from certain sender pass through pipe. So the email come in from STDIN, and out striped to STDOUT. Warning, is experimental but functional. i accept any help and suggestion about this. -- Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Kdepim-bugs mailing list Kdepim-bugs@kde.org https://mail.kde.org/mailman/listinfo/kdepim-bugs
[Bug 44880] would like to be able to strip tags from html messages
https://bugs.kde.org/show_bug.cgi?id=44880 --- Comment #19 from peter_s_d fastmail com au 2011-08-14 07:02:13 --- Torgny in #17, I am going blind. I want a screen reader. It will be easier to get a screen reader working properly if the intermediate step proposed above is already working. Sadly other people _send_ emails that do not conform to RFCs, or my taste. :-( There is nothing that we can do to stop them. I would strongly oppose generating non-standard messages. Do you really object to displaying messages any way that the recipient likes, or even needs? Christian in #18, How is your script supposed to be installed and used? Should it just be copied to somewhere on $PATH? -- Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Kdepim-bugs mailing list Kdepim-bugs@kde.org https://mail.kde.org/mailman/listinfo/kdepim-bugs
[Bug 44880] would like to be able to strip tags from html messages
https://bugs.kde.org/show_bug.cgi?id=44880 Torgny Nyblom nyb...@kde.org changed: What|Removed |Added Component|messageviewer |messageviewer Version|1.4.1 |unspecified Product|kmail |kdepim --- Comment #20 from Torgny Nyblom nyblom kde org 2011-08-14 14:25:16 --- (In reply to comment #19) I want a screen reader. It will be easier to get a screen reader working properly if the intermediate step proposed above is already working. Sadly other people _send_ emails that do not conform to RFCs, or my taste. :-( Use case for helping screen readers: Yes that is a valid argument in my book. Fixing mails that do not conform to personal taste is not. There is nothing that we can do to stop them. I would strongly oppose generating non-standard messages. Do you really object to displaying messages any way that the recipient likes - yes, the formatting of a mail is up to the sender to decide, also any reformatting means more code for us to maintain. , or even needs? - no, due to that I'll see what I can do. -- Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Kdepim-bugs mailing list Kdepim-bugs@kde.org https://mail.kde.org/mailman/listinfo/kdepim-bugs
[Bug 44880] would like to be able to strip tags from html messages
https://bugs.kde.org/show_bug.cgi?id=44880 --- Comment #18 from Christian Schmitz list schweb com ar 2011-08-09 14:45:15 --- I write this script, need be refined in case of img tag when is slited into 2 different lines. This script remove any type of html tag keeping links to images as text, links to url is keeped as text. I hope was usefull to the comunity. #!/usr/bin/perl # script que convierte los emails HTML a TXT # ideal para usar en kmail # # # $block=0 // no se acarrea nada del renglon anterior # $block=1 // se esta buscando una URL (ej: img src=http: ) que fue iniciado en otro renglon # $block=2 // se esta buscando un FIN de tag HTML que fue iniciado en otro renglon. # $filtrado=0;#Si ha habido alguna linea filtrada $activo=1;#Debe parsear el mail $special=0;# $block=0; #Se esta borrando un block de renglones $block_fin=; $str_fin=; @htmltags=( html, /html, body, /body, table, /table, tr, /tr, td, /td, hr, pre, /hr, b, /b, p, /p, !--, /a, span, /span, font, /font, style, script, ); @htmltags2=( , , , , , , , , , , , , , , , , , , , , , , , /style, /script, ); @htmlspecial1=( a, img, ); @htmlspecial2=( href=, src=, ); @htmlspecial3=( , , ); open(IN,/dev/stdin); #open(IN,kmail-samle-mail.txt); while(IN){ $reng=$_; chomp $reng; print \nIN :$reng\n; $reng=~s/br/\n/; if( $block==1 ){ $reng=strip_url($reng,$block_fin); } if( $block==2 ){ $reng=strip_fin($reng,$block_url,$block_fin); } if( $block==0 ){ $tag_n=0; foreach $tag (@htmltags){ $str_fin=$htmltags2[$tag_n]; while($reng=~/$tag/){ $reng=strip($tag,$reng,$str_fin); } $tag_n++; } $tag_n=0; while($reng=~/\img/){ my $tag=img; my $str_url=src=; my $str_fin=; $reng=strip_special($reng,$tag,$str_url,$str_fin); } } #if( length($reng)0){ print b=$block : $reng\n; print $reng\n; #}; # if( $filtrado20){ #exit 0; # } print:; } close IN; if( $filtrado!=0){ print filtrado por kmail-html-strip\n; } ### # sub strip{ my $tag =$_[0]; my $reng=$_[1]; my $str_fin=$_[2]; my $r_len=length($reng); my $t_len=length($tag); my $s_len=length($str_fin); my $inicio=0; while(substr($reng,$inicio,$t_len) ne $tag $inicio= $r_len){$inicio++;} $fin=$inicio+$s_len; while(substr($reng,$fin,$s_len) ne $str_fin $fin= $r_len){$fin++;} $reng=substr($reng,0,$inicio).substr($reng,$fin+$s_len); if($fin$r_len substr($reng,$fin,$s_len) ne $str_fin){ $block_fin=$str_fin; $block=2; } $filtrado++; return $reng } # # En caso de tag abierto antes # sub strip_fin{ my $reng =$_[0]; my $str_fin=$_[1]; my $r_len =length($reng); my $fin =0; my $s_len=length($str_fin); #while(substr($reng,$fin,1) ne $fin= $r_len){$fin++;} while(substr($reng,$fin,$s_len) ne $str_fin $fin= $r_len){$fin++;} $reng=substr($reng,$fin+$s_len); if($fin$r_len substr($reng,$fin,1) ne ){ $block=2; }else{ $block=0; } return $reng; } sub strip_url{ my $reng =$_[0]; my $str_url=$_[1]; my $str_fin=$_[2]; my $r_len=length($reng); my $t_len=length($tag); my $u_len=length($str_url); my $f_len=length($str_fin); my $url_ini=0; my $url_fin=0; my $tag_fin=0; while(substr($reng,$url_ini,$u_len) ne $str_url $url_ini= $r_len){$url_ini++;} print tag_ini=--- url_ini=$url_ini url_fin= tag_fin=- r_len=$r_len\n; if($url_ini$r_len substr($reng,$url_ini,$u_len) ne $str_url){ # solo se inicio el tag sin encontrarse URL $block_url=$str_fin; $block_fin=$str_fin; $block=1; $reng=; #$reng= substr($reng,0,$tag_ini); return } $block=0; $url_ini=$url_ini+$u_len; $url_fin=$url_ini+$u_len+1; while($url_fin=$r_len){ $tp=substr($reng,$url_fin,1); if ( $tp eq \ || $tp eq || $tp eq ){ last; } $url_fin++; } $tag_fin=$url_fin; while(substr($reng,$tag_fin,$f_len) ne $str_fin $tag_fin= $r_len){$tag_fin++;} if($tag_fin$r_len substr($reng,$tag_fin,$f_len) ne $str_fin){ $block_fin=$str_fin; $block=2; } print tag_ini=--- url_ini=$url_ini url_fin=$url_fin
[Bug 44880] would like to be able to strip tags from html messages
https://bugs.kde.org/show_bug.cgi?id=44880 Torgny Nyblom nyb...@kde.org changed: What|Removed |Added Component|general |messageviewer --- Comment #15 from Torgny Nyblom nyblom kde org 2011-08-08 12:04:54 --- Is there anyway this could be made using QtWebKit? If not then the program used should be configurable as some might have another text mode browser installed. And what is the real usecase for this? HTML display only uses html elements present in the actual mail and executes no scripts or does any access to the internet without being told so by the user. -- Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Kdepim-bugs mailing list Kdepim-bugs@kde.org https://mail.kde.org/mailman/listinfo/kdepim-bugs
[Bug 44880] would like to be able to strip tags from html messages
https://bugs.kde.org/show_bug.cgi?id=44880 --- Comment #16 from Thomas Fischer fischer unix-ag uni-kl de 2011-08-08 12:16:18 --- (In reply to comment #15) Is there anyway this could be made using QtWebKit? To my knowledge no, as WebKit is made for graphical presentation of HTML code and you still would need some translation step. Using lynx would avoid re-inventing the wheel. If not then the program used should be configurable as some might have another text mode browser installed. That would be possible. My patch so far is just a proof-of-concept and can be expanded. My idea would be to keep it automagically if possible, i.e automatically falling back to e.g. links2 if lynx is not available. And what is the real usecase for this? HTML display only uses html elements present in the actual mail and executes no scripts or does any access to the internet without being told so by the user. It is not only about malicious HTML code, but also about really badly formatted HTML code such as spam, mails from people with bad taste regarding fonts and colors, purists who despise any formatting at all, but like to keep a basic text structure etc. -- Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Kdepim-bugs mailing list Kdepim-bugs@kde.org https://mail.kde.org/mailman/listinfo/kdepim-bugs
[Bug 44880] would like to be able to strip tags from html messages
https://bugs.kde.org/show_bug.cgi?id=44880 --- Comment #17 from Torgny Nyblom nyblom kde org 2011-08-09 05:55:14 --- If I understand correctly this is for those who get html only mail (against the RFC:s) and who wish to overrule the formatting. If this is true then I wont' accept this patch as it adds more then it solves. If not could you please clarify for me the real usage? -- Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Kdepim-bugs mailing list Kdepim-bugs@kde.org https://mail.kde.org/mailman/listinfo/kdepim-bugs
[Bug 44880] would like to be able to strip tags from html messages
https://bugs.kde.org/show_bug.cgi?id=44880 --- Comment #14 from Thomas Fischer fischer unix-ag uni-kl de 2011-08-07 12:30:22 --- Created an attachment (id=62637) -- (http://bugs.kde.org/attachment.cgi?id=62637) Prototype patch to integrate lynx in KMail This is a patch which uses lynx to render HTML code to plain text. I had no recent kdepim libraries installed (hacked at DS 2011), but the concept should be clear. If there is interest in such a solution, I will look into refining it. -- Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Kdepim-bugs mailing list Kdepim-bugs@kde.org https://mail.kde.org/mailman/listinfo/kdepim-bugs
[Bug 44880] would like to be able to strip tags from html messages
https://bugs.kde.org/show_bug.cgi?id=44880 Thomas Fischer fisc...@unix-ag.uni-kl.de changed: What|Removed |Added CC||fisc...@unix-ag.uni-kl.de --- Comment #13 from Thomas Fischer fischer unix-ag uni-kl de 2010-12-01 13:50:46 --- A feature such as with lynx -dump would be nice. Lynx converts everything to plain text, but considers HTML formatting, e.g. for list environments. BTW, what is KDE's or Kontact's policy on using external programs like lynx? I.e. it would be easy to check during run-time to see if lynx is available and use it to render an HTML text, but fall back to the current behavior if it was not available. -- Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Kdepim-bugs mailing list Kdepim-bugs@kde.org https://mail.kde.org/mailman/listinfo/kdepim-bugs
[Bug 44880] would like to be able to strip tags from html messages
http://bugs.kde.org/show_bug.cgi?id=44880 Thomas Thym ungethym mevin net changed: What|Removed |Added CC||[EMAIL PROTECTED] --- Comment #12 from Thomas Thym ungethym mevin net 2008-12-09 14:30:03 --- Great idea! I like it. Maybe it is possible to add those 3 or 4 buttons in the header (to gether with load external images instead of the red warning text). It would make it much more easier for me to read mails and so switch between text and html modes. Cheers, Thomas -- Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Kdepim-bugs mailing list Kdepim-bugs@kde.org https://mail.kde.org/mailman/listinfo/kdepim-bugs
[Bug 44880] would like to be able to strip tags from html messages
http://bugs.kde.org/show_bug.cgi?id=44880 --- Comment #7 from peter_s_d fastmail com au 2008-12-07 13:12:54 --- Just often enough to be annoying. -- Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Kdepim-bugs mailing list Kdepim-bugs@kde.org https://mail.kde.org/mailman/listinfo/kdepim-bugs
[Bug 44880] would like to be able to strip tags from html messages
http://bugs.kde.org/show_bug.cgi?id=44880 Allan Sandfeld kde carewolf com changed: What|Removed |Added CC||[EMAIL PROTECTED] --- Comment #10 from Allan Sandfeld kde carewolf com 2008-12-08 00:14:34 --- KMail could use the DOM feature element.innerText, this works like innerHTML except it strips all HTML/XML tags. So after KHTML has parsed a page/email, you can access the plain-text version by reading body.innerText. -- Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ Kdepim-bugs mailing list Kdepim-bugs@kde.org https://mail.kde.org/mailman/listinfo/kdepim-bugs