Re: Reg Exp "ReWrap" macro that worked in TB! v4.0.38 not working correctly in v7.

2016-09-13 Thread MFPA
Hi


On Sunday 11 September 2016 at 12:58:14 PM, in
, MFPA wrote:-


> Hi

> Since upgrading from TB! v4 to v7, I have noticed
> extra blank lines

> appearing in the quoted text when I reply to some
> messages. 

> I had time today to investigate which messages this
> happens for. It

> seems to be where the reply template invokes Januk
> Aggarwal's "ReWrap"

> macro [0] to "Recursively wrap quoted reply text". 


It's simpler than I thought. Januk Aggarwal's "ReWrap" makes use of 
the %WRAPPED macro. I get the same issue if I forego the RegExp bit 
and just use %quotes(%WRAPPED(63,%TEXT)).


-- 
Best regards

MFPA  

We are all in the gutter, but some of us are looking at the stars

Using The Bat! v7.2.0.2 (BETA) on Windows 10.0 Build 10586  


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Current version is 7.1 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Reg Exp "ReWrap" macro that worked in TB! v4.0.38 not working correctly in v7.

2016-09-11 Thread MFPA
Hi

Since upgrading from TB! v4 to v7, I have noticed extra blank lines
appearing in the quoted text when I reply to some messages. 

I had time today to investigate which messages this happens for. It
seems to be where the reply template invokes Januk Aggarwal's "ReWrap"
macro [0] to "Recursively wrap quoted reply text". 

In TB! v4.0.38 (and earlier) this worked as expected, but in TB! v7.2
extra blank lines are inserted after what was the last word on each
line in the original message.

To illustrate:-
   Lorem ipsum dolor sit amet, consectetur adipiscing 
   elit, sed do eiusmod tempor incididunt ut labore et 
   dolore magna aliqua. Ut enim ad minim veniam, quis 
   nostrud exercitation ullamco laboris nisi ut aliquip ex 
   ea commodo consequat. 
   
   
should be quoted as:-
   > Lorem ipsum dolor sit amet, consectetur adipiscing 
   > elit, sed do eiusmod tempor incididunt ut labore 
   > et dolore magna aliqua. Ut enim ad minim veniam, 
   > quis nostrud exercitation ullamco laboris nisi ut 
   > aliquip ex ea commodo consequat. 


but is now quoted as:-
   > Lorem ipsum dolor sit amet, consectetur adipiscing
  
   > elit, sed do eiusmod tempor incididunt ut labore 
   > et
  
   > dolore magna aliqua. Ut enim ad minim veniam, quis
 
   > nostrud exercitation ullamco laboris nisi ut 
   > aliquip ex
 
   > ea commodo consequat. 
   

   
Has there been a change in how TB! handles Regular Expressions that 
would account for this behaviour? And what should I tweak to make this 
work properly in the current TB! version?




[0] Januk Aggarwal's "ReWrap" macro is in "The Bat! Macro and 
Solutions Library" at 
. That link is not 
currently working properly, but the Way Back Machine has a snapshot at 
.




The actual Quick Template text is:-


=[Begin example driver]=
%_Wrap_Text="%Quotes"%-
%Rem="This line is optional"%___%_Wrap_Limit="50"%-
%QInclude(wrap)%-
=[ End  example driver]=

=[Begin wrap template]=
%REM='
   Multi-Paragraph wrapping routine using features from TB v2
   Written June 2003 by Januk Aggarwal

   Notes:
  1. This template can be used alone to wrap clipboard
 contents or can be used as a wrapping engine by assigning
 text to the variable, %_Wrap_Text, in the driver template.
  2. Wrapping limit can be set optionally by defining the
 variable %_Wrap_Limit in the driver template
'%-
%-
%IF:'%_Wrap_FirstTime'='':'%-
%___%IF:"%_Wrap_Text"="":"%_Wrap_Text(%Clipboard)"%-
%___%_Wrap_FirstTime="No"'%-
%-
%IF:'%-
%SetPattRegexp="(?is-m)[^\n]+"%-
%RegexpMatch(%_Wrap_Text)'<>'':'%-
%-
%SetPattRegexp="(?is-m)^(.*?)((\n((\w{0,5}(\>\s*)+)?\s*\n)+)(.*)\s*$|\z)"%-
%RegexpBlindMatch(%_Wrap_Text)%-
%-
%_Wrap_Paragraph_1(%Subpatt(1))%-
%_Wrap_Blank_Space(%Subpatt(3))%-
%_Wrap_Remainder_Of_Text(%Subpatt(7))%-
%-
%If:"%_Wrap_Limit"="":"%-
%%Wrapped(%_Wrap_Paragraph_1)":"%-
%%Wrapped(%_Wrap_Limit, %_Wrap_Paragraph_1)"

%_Wrap_Text(%_Wrap_Remainder_of_Text)%-
%-
%QInclude(wrap)'%-
=[ End  wrap template]=




-- 
Best regards

MFPA  

To steal ideas from one person is plagiarism; 
to steal from many is research.

Using The Bat! v7.2.0.2 (BETA) on Windows 10.0 Build 10586  


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Current version is 7.1 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html