Page Index Toggle Pages: 1
Topic Tools
 10 [Standard] [noparse] also for Smilies (Read 6,929 times)
Jet Li
Legacy Dev Team
Development Team
****
Offline



Posts: 6,588
Location: Hong Kong
Re: [Standard] [noparse] also for Smilies
Reply #14 - May 9th, 2010 at 10:09pm
Post Tools
aha. Just add [ noparse]...[/noparse] tag. Then works fine. Smiley

New
Sources/YaBBC.pl
in CVS.
« Last Edit: May 9th, 2010 at 10:09pm by Jet Li »  

PM me for YaBB Installation Service
Back to top
WWWGTalkFacebook  
IP Logged
 
Matt Siegman
YaBB Legends (Inactive)
*
Offline



Posts: 3,380
Location: Wichita, KS
Re: [Standard] [noparse] also for Smilies
Reply #13 - May 9th, 2010 at 10:05pm
Post Tools
Works for me?

http://www.yabbworld.com/cgi-bin/yabbcvs/YaBB.pl?num=1273384065/0#1

That captcha is darn hard to use!

We'd obviously need to test this more, but it looks like it may just work.
  

-- Matt Siegman 8) Wish List
Back to top
 
IP Logged
 
Jet Li
Legacy Dev Team
Development Team
****
Offline



Posts: 6,588
Location: Hong Kong
Re: [Standard] [noparse] also for Smilies
Reply #12 - May 9th, 2010 at 5:57am
Post Tools
I upload to my testforum. But Smiley still there.
http://www.yabbworld.com/cgi-bin/yabbcvs/YaBB.pl?num=1273384065
  

PM me for YaBB Installation Service
Back to top
WWWGTalkFacebook  
IP Logged
 
Matt Siegman
YaBB Legends (Inactive)
*
Offline



Posts: 3,380
Location: Wichita, KS
Re: [Standard] [noparse] also for Smilies
Reply #11 - May 8th, 2010 at 11:40pm
Post Tools
I'm having trouble with CVS. Here's the patch for the Perl code.

I have to attach it since it's smiley code and gets a bit.... mangled....

And I had to change the extension....
« Last Edit: May 8th, 2010 at 11:43pm by Matt Siegman »  

yabb_diff.txt ( 2 KB | 134 Downloads )

-- Matt Siegman 8) Wish List
Back to top
 
IP Logged
 
Matt Siegman
YaBB Legends (Inactive)
*
Offline



Posts: 3,380
Location: Wichita, KS
Re: [Standard] [noparse] also for Smilies
Reply #10 - May 8th, 2010 at 11:08pm
Post Tools
I changed how some things work, this should be fixed in the Perl now.

I moved the bulk of the code to a "private" function _do_ubbc with actual parameters and returns. DoUBBC is just a wrapper for it. I've changed some other code to cope with this.

It's semi-recursive. I'm sure there could be a better way to do it, but this was the quickest.

Please test this. Once we've confirmed everything works right, we can call this fixed.
« Last Edit: May 8th, 2010 at 11:44pm by Matt Siegman »  

-- Matt Siegman 8) Wish List
Back to top
 
IP Logged
 
deti
Legacy Dev Team
Development Team
****
Offline



Posts: 2,650
Location: Prien am Chiemsee, Germany
Re: Re: Add [noparse] to YaBBC and "don't parse" checkbox
Reply #9 - Jul 20th, 2009 at 3:27pm
Post Tools
This Topic was moved here from YaBB 2 - Bugs [Fixed] [move by] deti.
  

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
Back to top
WWW  
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Add [noparse] to YaBBC and "don't parse" checkbox
Reply #8 - Jul 18th, 2009 at 7:52pm
Post Tools
deti wrote on Jul 18th, 2009 at 3:01pm:
Did you apply my code from post #34 on your testforum before you wrote your last posts?

Oh, whoops.  No, I did not.  I'll try that again, sorry.  I'm wondering if there's a better way to do it than to replace all the punctuation characters with HTML entities, though... that seems inefficient.

I'll look into the smiley code and see if I can find a better way.  Maybe there isn't one...
  
Back to top
WWW  
IP Logged
 
deti
Legacy Dev Team
Development Team
****
Offline



Posts: 2,650
Location: Prien am Chiemsee, Germany
Re: Add [noparse] to YaBBC and "don't parse" checkbox
Reply #7 - Jul 18th, 2009 at 3:01pm
Post Tools
@ cepheid
Did you apply my code from post #34 on your testforum before you wrote your last posts? Doesn't look so for me because on my testforum with this code it works!
« Last Edit: Jul 18th, 2009 at 3:02pm by deti »  

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
Back to top
WWW  
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Add [noparse] to YaBBC and "don't parse" checkbox
Reply #6 - Jul 17th, 2009 at 9:48pm
Post Tools
Quote:
There is a undocumented way of not parsing smilies using "# nosmileys" (no space):

But that turns smilies off for the whole post, the same as the checkbox.  I'm talking about turning it off locally for individual words/phrases.
  
Back to top
WWW  
IP Logged
 
Carsten
Ex Member


Re: Add [noparse] to YaBBC and "don't parse" checkbox
Reply #5 - Jul 17th, 2009 at 8:34pm
Post Tools
There is a undocumented way of not parsing smilies using "# nosmileys" (no space):

Method::Data
« Last Edit: Jul 17th, 2009 at 8:36pm by »  
Back to top
 
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Add [noparse] to YaBBC and "don't parse" checkbox
Reply #4 - Jul 17th, 2009 at 7:05pm
Post Tools
deti wrote on Jul 17th, 2009 at 1:05pm:
he code does exactly this!!!

No, it doesn't... noparse only turns off YaBBC, it does not turn off smilies.  The checkbox at the bottom turns off smilies as well as YaBBC, but the noparse tag turns off UBBC only.  Try the following:
Code
Select All
[ noparse ]Method::Data[ /noparse ] 


It renders like this:
Method::Data

Even though YaBBC is turned off for that line, the smileys are not, leading to this display problem.  It is not always convenient to enclose things in [code] boxes, like when discussing things in regular English.  Also, I might not want to turn smilies or code off for the whole message, because I might want to actually use smilies or code... I just don't want certain things like Method::Data to render with smilies.  Surrounding them with doesn't help at the moment.

(Also, a bug: the [noparse] tags within a [code] block are interpreted and removed by YaBB.  This should not happen.  [code] blocks should interpret [highlight] only...)
« Last Edit: Jul 17th, 2009 at 7:07pm by cepheid »  
Back to top
WWW  
IP Logged
 
deti
Legacy Dev Team
Development Team
****
Offline



Posts: 2,650
Location: Prien am Chiemsee, Germany
Re: Add [noparse] to YaBBC and "don't parse" checkbox
Reply #3 - Jul 17th, 2009 at 1:05pm
Post Tools
cepheid wrote on Jul 17th, 2009 at 11:23am:
That also doesn't solve the smiley problem within messages

Huh Why not? For me it does!

[quote author=5553465E535F52360 link=1242670230/35#35 date=1247829795]If we expand to also ignore smileys, that also solves the signature problem (since the user can simply [noparse] their signature).[/quote]
The code does exactly this!!! :-?
« Last Edit: Jul 17th, 2009 at 1:07pm by deti »  

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
Back to top
WWW  
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Add [noparse] to YaBBC and "don't parse" checkbox
Reply #2 - Jul 17th, 2009 at 11:23am
Post Tools
deti wrote on Jul 17th, 2009 at 10:30am:
If ubbc-tags are allowed the signature runs through YaBBC.pl and therefore smilies are also parsed.

Ack, that is a lot of replacement code.  That also doesn't solve the smiley problem within messages (e.g. Module:Cheesyata).  If we expand to also ignore smileys, that also solves the signature problem (since the user can simply [noparse] their signature).
  
Back to top
WWW  
IP Logged
 
deti
Legacy Dev Team
Development Team
****
Offline



Posts: 2,650
Location: Prien am Chiemsee, Germany
Re: Add [noparse] to YaBBC and "don't parse" checkbox
Reply #1 - Jul 17th, 2009 at 10:30am
Post Tools
cepheid wrote on Jul 16th, 2009 at 10:56pm:
In fact, is it even possible to disable smilies within signatures?

If ubbc-tags are allowed the signature runs through YaBBC.pl and therefore smilies are also parsed.

Try this to prevent this:
In YaBBC.pl
Code
Select All
	sub noparse {
		my $noubbc = $_[0];
		$noubbc =~ s~([;!\(\)\-\.\/:\?\[\\\]\^D])~$killhash{$1}~g;
		$noubbc;
	} 



and in yabbc.js
Code
Select All
	while( a=ubbcstr.match(/\[noparse\]\n*(.*?)\n*\[\/noparse\]/i) ) {
		var npmessage=a[1];
		npmessage=npmessage.replace(/\;/g, "&#59;");
		npmessage=npmessage.replace(/\./g, ".");
		npmessage=npmessage.replace(/\//g, "/");
		npmessage=npmessage.replace(/\[/g, "[");
		npmessage=npmessage.replace(/\]/g, "]");
		npmessage=npmessage.replace(/\!/g, "!");
		npmessage=npmessage.replace(/\(/g, "(");
		npmessage=npmessage.replace(/\)/g, ")");
		npmessage=npmessage.replace(/\-/g, "-");
		npmessage=npmessage.replace(/\./g, ".");
		npmessage=npmessage.replace(/\//g, "/");
		npmessage=npmessage.replace(/\:/g, ":");
		npmessage=npmessage.replace(/\?/g, "?");
		npmessage=npmessage.replace(/\\/g, "\");
		npmessage=npmessage.replace(/\^/g, "^");
		npmessage=npmessage.replace(/D/g,  "D");
		ubbcstr=ubbcstr.replace(/\[noparse\]\n*(.*?)\n*\[\/noparse\]/i, npmessage);
	} 

« Last Edit: Jul 17th, 2009 at 11:04am by deti »  

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
Back to top
WWW  
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
[Standard] [noparse] also for Smilies
Jul 16th, 2009 at 10:56pm
Post Tools
deti wrote on May 26th, 2009 at 11:00am:
- The [ noparse ]-tag disables only UBBC between his tags.

I wonder if we shouldn't change this so that actually will disable smilies, as well.  Why?  Look at Matt Siegman's signature... YaBB3::DataSource.

In cases like that and in regular discussions that may involve some code, it's not always proper or beneficial to use [code] tags (because you don't want to use a [code] box for one word), and it might not be correct to disable smilies within the whole post, either, when you just want to disable them in a certain word (to prevent parsing problems like above).

In fact, is it even possible to disable smilies within signatures?  I don't recall that even being an option.  Of course, if [noparse] were modified to ignore smilies, that would provide the option automatically.
« Last Edit: Mar 25th, 2010 at 3:02am by »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Topic Tools
 
  « Board Index ‹ Board  ^Top