ustring* ans = new ustring;
ans->reserve (uWiki.length () + name.length ());
- ans->append (uWiki);
- ans->append (name);
+ if (name.length () >= 1 && name[0] == '@') {
+ ans->append (uAWiki);
+ ans->append (name.begin () + 1, name.end ());
+ } else {
+ ans->append (uWiki);
+ ans->append (name);
+ }
return ans;
}
static ustring* wikivar_ary (const ustring& name) {
ustring* ans = new ustring;
- ans->reserve (uWiki.length () + name.length () + 1);
- ans->append (CharConst ("@"));
- ans->append (uWiki);
- ans->append (name);
+ ans->reserve (uAWiki.length () + name.length ());
+ if (name.length () >= 1 && name[0] == '@') {
+ ans->append (uAWiki);
+ ans->append (name.begin () + 1, name.end ());
+ } else {
+ ans->append (uAWiki);
+ ans->append (name);
+ }
return ans;
}
Return string prefixed with 'wiki_'.
Return string prefixed with '@wiki_'.
+If NAME begins with '@' returns '@wiki_' followed by NAME without '@'.
+
*/
//#AFUNC wikivar ml_wikivar
//#AFUNC wikivar@ ml_wikivar_ary