🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
3 messages
3 total messages Started by Anon Tue, 03 Apr 2012 17:30
--
#84675
Author: Anon
Date: Tue, 03 Apr 2012 17:30
155 lines
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& ;
--
#84676
Author: Anon
Date: Tue, 03 Apr 2012 20:09
17 lines
1848 bytes
ďťż<PRE>
Re: "Jeff (BOM-O-MATIC) Relf is &lt;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
#84678
Author: Michael Moroney
Date: Wed, 04 Apr 2012 04:36
33 lines
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