OSDN Git Service

fix anchor of the wiki link.
authorvisor <visor@users.sourceforge.jp>
Sat, 13 Jun 2015 07:35:49 +0000 (16:35 +0900)
committervisor <visor@users.sourceforge.jp>
Sat, 13 Jun 2015 07:35:49 +0000 (16:35 +0900)
wiki/wikimotor.cc

index 319a274..bc2da51 100644 (file)
@@ -405,7 +405,7 @@ bool  WikiMotorObjVec::splitURL (WikiFormat* wiki, ustring& url) {
            if (params.length () > 0)
                url.append (CharConst ("?")).append (params);
            if (anchor.length () > 0)
-               url.append (CharConst ("#")).append (anchor);
+               url.append (anchor);
            return true;
        } else {
            return false;
@@ -417,7 +417,6 @@ bool  WikiMotorObjVec::splitURL (WikiFormat* wiki, ustring& url) {
 
 // "[proto]:" part is excluded.
 bool  WikiMotorObjVec::splitURL_2 (WikiFormat* wiki, ustring& host, ustring& path, ustring& params, ustring& anchor) {
-
     if (size () > 0) {
        WikiMotorObj*  o;
        o = operator [] (0).get ();
@@ -459,7 +458,7 @@ bool  WikiMotorObjVec::splitURL_2 (WikiFormat* wiki, const ustring& proto, ustri
            if (params.length () > 0)
                url.append (CharConst ("?")).append (params);
            if (anchor.length () > 0)
-               url.append (CharConst ("#")).append (anchor);
+               url.append (anchor);
            return true;
        } else {
            return false;
@@ -499,7 +498,7 @@ bool  WikiMotorObjVec::splitURL_3 (WikiFormat* wiki, const ustring& protohost, u
        if (params.length () > 0)
            url.append (CharConst ("?")).append (params);
        if (anchor.length () > 0)
-           url.append (CharConst ("#")).append (anchor);
+           url.append (anchor);
        return true;
     }
     return false;
@@ -563,7 +562,7 @@ bool  WikiMotorObjVec::splitURLPath (WikiFormat* wiki, ustring& path, ustring& p
     }
 
     if (fanchor) {
-       anchor = percentEncode (vanchor.textOut (wiki));
+       anchor = ustring (CharConst ("#")).append (percentEncode (vanchor.textOut (wiki)));
     }
 
     return true;
@@ -577,7 +576,7 @@ bool  WikiMotorObjVec::splitURLPath (WikiFormat* wiki, ustring& url) {
        if (params.length () > 0)
            url.append (CharConst ("?")).append (params);
        if (anchor.length () > 0)
-           url.append (CharConst ("#")).append (anchor);
+           url.append (anchor);
        return true;
     } else {
        return false;