Hi guys,

I've found one "bug" in the current "slice value part" of the slicesRE. 
This bug caused some troubles with themes to Alfonso Arciniega [1]. The 
current "slice value" part of the slicesRE is this

[\t\x20]*([^\|\n]*)[\t\x20]*

which means that if one specifies a slice like this

|PageTemplate| WebPageTemplate |

he or she gets the slice value as "WebPageTemplate ". I haven't debuged 
this, just tried different variants:

|PageTemplate| WebPageTemplate |
|PageTemplate| WebPageTemplate|
|PageTemplate|WebPageTemplate |
|PageTemplate|WebPageTemplate|

and those with a spacebar after the "implied slice value" doesn't work 
while those without trailing spacebars work. I guess this is because 
matching process tries to match

[\t\x20]*([^\|\n]*)

 first and that actually matches, giving the spacebar in the slice value; 
and than the trialing

[\t\x20]*

 matches as zero spacebars.

----

This "bug" is inherited in my slicesRE (althought I prevented it in slice 
names by explicitly forbidding white-space symbols as first and last ones 
in the "slice name part":

[^\|\s\:\~\'\/]|(?:[^\|\s~\'\/][^\|\n\f\r]*[^\|\s\:\'\/])

). Now, to solve this issue, I changed the "slice value part" of my slicesRE

[\t\x20]*([^\n]+)[\t\x20]*

to this:

[\t\x20]*([^\n\t\x20](?:[^\n]*[^\n\t\x20])?)[\t\x20]*

so now both leading and trailing spaces/tabs in the "value part of the 
table" are not accounted as parts of a slice value.

PS if someone explains how the testing system works, may be I can start to 
add tests for the new slices. On the other hand, Eric haven't commented 
this ticket yet, so I'm bit lost about the status of this proposal.

[1] 
https://groups.google.com/forum/?fromgroups=#!topic/tiddlywiki/9S8R5Sk2niA

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to