Thread View: news.software.nntp
3 messages
3 total messages
Started by Anon
Tue, 03 Apr 2012 17:30
--
Author: Anon
Date: Tue, 03 Apr 2012 17:30
Date: Tue, 03 Apr 2012 17:30
155 lines
7718 bytes
7718 bytes
ďťż
How do you ( Michaelâ
Moroney ) manage to keep missing the point ? !
Google Groups is the best way to link to a post.
Variableâ
width glyphs are the default there and elsewhere;
so, to insure a monospaced font, use the PRE tag.
There are many ways to display HTML,
emacs and slrn â
shouldâ
be one way, but they can't manage it;
so Ray Banana's noobâ
fest, Eternalâ
September, drops HTML posts.
My HTMLâ
toâ
Plainâ
Text code has changed again ( and again ).
>From Jeff-Relf.Me/X.CPP:
#define While( âť ) Ch = 1, P-- ; while( ( Châ1 = Ch ) && ( Ch = *++P, Ch2 = !Ch ? 0 : P[1], âť ) )
// "While(0)" ( for example ) would loop zero times and not alter P,
// but sets Ch and Ch2 to P[0] and P[1], respectively.
//
// Essentially, the macro is "while( A && B )" where
// B sets Ch and increments P.
//
// B won't happen unless A is true. First time through the loop,
// A is true. Second pass, A is false when, initially, "*P == 0".
#define WhileBac( âť ) \
Ch = Ch2 = 0, E ? 0 : E = B + szStr( B ), P = E ; \
while ( P >= B && ( Ch2 = *P, ( Ch = --P < B ? 0 : *P ) && ( âť ) ) )
// Don't indent "footers" ( i.e. links, tag IDs and Alt text ).
// Make plainâ
text stand out, indent it 4 spaces and
// put a newline before and after each block of plainâ
text.
// Wrap to "mxCols" ( 121 columns, monospaced ).
const int mxCols = ColsWin - 6 ;
int âĄ, iPP, PRE, inTag, Openâ
A ; LnT _id, _Alt, _Src, _hRef ;
Cat( LnP B², int Sz² ) { if ( Sz² <= 0 ) return;
LnP &Bš = *Ln.PP, BšâşÂ˛ ; int Szš = szStr( Bš ), SzšâşÂ˛ = Szš + Sz² ;
if ( !Szš || SzšâşÂ˛ > mxCols ) {
// Start a new line, don't append.
//
// When the current console line is blank (!Szš)
// and it's not Topâ
Most ( Topâ
Most must be a blank line )
// and the line above isn't a "Footer", remove it.
Ln.PP -= !Szš && Ln.PP > Ln.BB + iPP && *Ln.PP[-1] <= 32 ;
if ( Sz² < 4 || B²[2] != L'â' )
// Print the plainâ
text, indented.
Sh( L" %.*s", Sz², B² );
else
// Print the tag ID, not indented, omit the leading " ,".
Sh( L"%.*s", Sz²-=2, B²+=2 );
return; }
// Append, tag ID or plainâ
text.
BšâşÂ˛ = MallocTmp( ++SzšâşÂ˛ * szChr ), Str( BšâşÂ˛, L"%s%.*s", Bš, Sz², B² ), Bš = BšâşÂ˛ ; }
Cat( wchar_t Ch ) { Cat( &Ch, 1 ); }
// Print a new line or "âĄ", print footers.
Trim() { if ( ⥠= 0, Openâ
A ) return ; int Footers = _Alt.BB || _Src.BB || _hRef.BB || _id.BB ;
// Remove trailing whitespace and leading blank lines.
LOOP { B = *Ln.PP, E = 0 ; WhileBac( Ch == L'âĄ' || Ch <= 32 || Ch == L'\xA0' );
if ( ++P < E ) *P = 0 ; if ( !*B && Ln.PP > Ln.BB + iPP && !PRE ) Ln.PP-- ; else break ; }
if ( !PRE && *B == 32 && !( ⥠= !Footers ) )
// "Footers" follow plain text, print a blank line.
Sh(0);
if ( _hRef.BB ) { LoopXx( Ln, _hRef ) Sh( L"%s%s", âşFolder( B ), Human( B ) ); Zero( _hRef ); }
if ( _Alt.BB ) { LoopXx( Ln, _Alt ) Sh( L"%s", Human( B ) ); Zero( _Alt ); }
if ( _Src.BB ) { LoopXx( Ln, _Src ) Sh( L"%s%s", âşFolder( B ), Human( B ) ); Zero( _Src ); }
if ( _id.BB ) {
LoopXx( Ln, _id )
if ( Human(B), **Ln.PP != L'â' )
// Start a line of tag IDs.
Sh( L"â%s", B );
else
// Add to the line of tag IDs.
rv = Str( _T, L", â%s", B ), Cat( _T, rv );
Zero( _id ); } }
// Print a new line or "âĄ", print footers.
#define Br ( Trim(), Openâ
A ? Cat( 32 ) : !**Ln.PP && !*Ln.PP[-1] ? 0 : ⥠? Cat( L'âĄ' ) : Sh(0) )
#define feedMe { if ( !feedMeââ( B, P, PP, EE ) ) return ; }
int feedMeââ( LnP &B, LnP &P, LnA &PP, LnA EE ) { While(0); if ( Ch ) return 1 ;
// Read in a new line.
if ( PRE && !inTag ) Br;
else { LnP &T = *Ln.PP ; if ( rv = szStr( T ), rv && T[ rv - 1 ] > 32 ) Cat( 32 ); }
if ( ++PP >= EE || ( P = B = *PP, B && MimeSep && EqN( B, *MimeSep, Sz_MimeSep ) ) ) {
// All done !
Trim(); return 0 ; }
// Keep parsing.
While(0); return 1 ; }
// Parse out plainâ
text from tags/entities.
#define Châ
BoTagďź ( \
Ch == '&' && ( Ch2 == '#' || isAlpha( Ch2 ) ) \
|| Ch == '<' && ( Ch2 == '!' || Ch2 == '?' || isAlpha( Ch2 ) || Ch2 == '/' && isAlpha( P[2] ) ) )
HTMLâ
toâ
Text( LnA BB, LnA EE ) { static rv ; LnA PP = BB - 1 ;
if ( **Ln.PP ) Sh(0); iPP = Ln.PP - Ln.BB ;
LnP euText, B = L"", P = B, Alt, Src, id, hRef = 0 ; int PlainText ;
Zero( _Alt ), Zero( _Src ), Zero( _hRef ), Zero( _id );
PlainText = PRE = Ch = Openâ
A = 0 ;
â¤BoTagďź:
inTag = 0 ; feedMe
if ( PlainText ) { // Print unparsed.
euText = P, P += szStr( P ), Ch = 0 ; }
else { // Parse out plainâ
text from tags/entities.
euText = 0 ; While( !Châ
BoTagďź ) if ( !euText && Ch ) euText = P ; }
LnP BoTagďź = P ; LnA BoTagPP = PP ; if ( !euText ) goto Parseâ
Tag ;
{ LnP Bš, B², P², Eš, E² ; int Szš, Sz², SzâťÂ˛, SzšâşÂ˛, SP, SP², Ch, Ch2 ;
Bš = Eš = *Ln.PP, Szš = szStr( Bš ), Eš += Szš ;
if ( B² = euText, E² = BoTagďź, !PRE ) {
// Pemove redundent whitespace. What's left will be printed.
Ch = !Szš ? 0 : Eš[-1], SP = Ch <= 32, P² = B², D = B² - 1 ;
While²( P² < E² )
if ( SP² = Ch <= 32 || Ch == L'\xFeFF', !SP && SP² ) *++D = 32, SP = 1 ; else if ( !SP² ) *++D = Ch, SP = 0 ;
E² = ++D ; }
if ( Sz² = E² - B², Sz² <= 0 || Sz² == 1 && *B² <= 32 ) goto Parseâ
Tag ;
if ( PRE ) {
// Print the "PREâ
formatted" text, no wrapping.
Cat( B², Sz² ); goto Parseâ
Tag ; }
LOOP {
if ( SzšâşÂ˛ = Szš + Sz², SzšâşÂ˛ <= mxCols ) {
// Print as is, don't wrap.
Cat( B², Sz² ); goto Parseâ
Tag ; }
E² = B² + ER( 0, mxCols - Szš ); WhileBac²( Iden( Ch ) );
if ( SzâťÂ˛ = P² - B² + 1, SzâťÂ˛ >= 22 )
// Append part of the text to the current line.
Cat( B², SzâťÂ˛ ), Szš = Sh(0);
else
// Start a line, instead of appending.
if ( !SzâťÂ˛ )
// Start a blank line.
Szš = Sh(0);
else
// Start a new line with the text.
Szš = Sh( L" %.*s", SzâťÂ˛, B² );
// Print the rest of it, might be blank.
Sz² -= SzâťÂ˛, B² = ++P² ; } }
Parseâ
Tag:
// Parse the tag or entity.
inTag = 1 ; While(0); if ( !Ch ) goto â¤BoTagďź ;
--
Author: Anon
Date: Tue, 03 Apr 2012 20:09
Date: Tue, 03 Apr 2012 20:09
17 lines
1848 bytes
1848 bytes
ďťż<PRE>
Re: "Jeff (BOM-O-MATIC) Relf is <PRE> MATURE"
-- Anonymous, a.k.a. Junior, Tioat's admin.
Why "Anonymous" ? do you think you're plonked or what ?
Bank robbers ( like you, Ray Banana and Steve Crook )
are anonymous; doâ
gooders ( like me ) seek fame.
At any rate, Google Groups is the best way to link to a post.
Like it or not ( why not ? ) HTML and UTFâ
8 are part of Usenet.
There are many ways to display HTML,
better clients ( e.g. Thunderbird ) handle HTML emails and posts.
Your newsreader ( slrn, why hide it ? ) â
shouldâ
handle HTML,
instead of passing it off to some other app, no choice ! !
Re:  Jeff Relf's a long term noob
Author: Michael Moroney
Date: Wed, 04 Apr 2012 04:36
Date: Wed, 04 Apr 2012 04:36
33 lines
2553 bytes
2553 bytes
@Jeff-Relf.Me writes: How do you ( Michaelâ Moroney ) manage to keep missing the point ? How do you keep missing the point? My name is not "Michaelâ Moroney". >Google Groups is the best way to link to a post. No, the best way to reference a post is the Message-ID. You even keep telling us how great it is. In the unlikely event a post of mine gets referred to in a website (not counting Usenet-to-web sites for noobs, like Giggle Groups) I would expect the Message-ID to be listed and the appropiate sections quoted (in a monospaced font, if necessary) so that the reader doesn't have to look up a post. The Message-ID is for those who want to access the original on a long term server, or Google Groups (assuming it even works) Anyway, I feel nobody has an obligation to try to work around Google's bugs for a rare event. Esp. since HTML messes up C code, or code in any language with "<", ">", "&" etc. > so, to insure a monospaced font, use a proper Usenet reader. > My HTML to Plain Text code has changed again ( and again ). Nobody cares. <snip crap>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads