Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Zhiroc
Adept


Joined: 04 Feb 2005
Posts: 246

PostPosted: Tue Aug 14, 2007 1:09 pm   

#SUB, #PSUB, and angle brackets
 
I've always wondered why text substituted by #SUB obeys MXP tags, but that substituted by #PSUB doesn't. It would simplify and speed up triggers in some cases to support tags in #PSUB, rather than having to do reparse states in order to do this (I often create my own hyperlinks using <send> tags, or use <color> tags).

On the other hand, sometimes you don't want it interpreted. For example:
Code:
#TRIGGER {*bar} {#SUB {%1 xxx}}
#TRIGGER {*bar} {#SUB {%quote(%1) xxx}}

Do "#show <foo> bar" and you'll get " bar xxx" out of either.

Shouldn't the %quote() cause the angle brackets to get ignored?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue Aug 14, 2007 1:59 pm   
 
There weren't actually any captures in your pattern, so I assume you meant %line instead of %1.

The trouble is that MXP tags are parsed out even if they're quoted. This is probably for zMUD compatability, because in zMUD, you needed to escape the opening triangular bracket to avoid them being parsed. In CMUD, they're not special characters any more and don't need to be quoted.

Perhaps the best way to handle this would be to only expand MXP tags if they're valid?
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Aug 14, 2007 5:00 pm   
 
Supporting MXP tags in PSUB is on the to-do list for the future.

As Fang mentioned, the %quote function only quotes special CMUD characters, like #, %, etc. So you don't want to use it in your above situation, because if you did:

#SHOW "#test bar"

then you would get "~#test bar" which probably isn't what you want either.

What we need is something like the PHP htmlencode that will encode the < and > into their XML entities. I'll add that to the wish list for the future.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Wed Aug 15, 2007 9:49 pm   
 
Ooh, htmlencode sounds nice - I found in zMUD that in adding my own MXP tags, I had to vary the syntax (i.e. quoting) depending on what type of setting it was in - it was not consistent.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net