File tree Expand file tree Collapse file tree 2 files changed +3
-15
lines changed Expand file tree Collapse file tree 2 files changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,8 @@ import type {
44 NotMemberError ,
55 Page ,
66} from "../deps/scrapbox.ts" ;
7- import {
8- cookie ,
9- encodeTitle ,
10- makeCustomError ,
11- tryToErrorLike ,
12- } from "./utils.ts" ;
7+ import { cookie , makeCustomError , tryToErrorLike } from "./utils.ts" ;
8+ import { encodeTitleURI } from "../title.ts" ;
139import type { Result } from "./utils.ts" ;
1410
1511/** Options for `getPage()` */
@@ -34,7 +30,7 @@ export async function getPage(
3430 >
3531> {
3632 const path = `https://scrapbox.io/api/pages/${ project } /${
37- encodeTitle ( title )
33+ encodeTitleURI ( title )
3834 } ?followRename=${ options ?. followRename ?? true } `;
3935
4036 const res = await fetch (
Original file line number Diff line number Diff line change @@ -56,11 +56,3 @@ export function makeCustomError(name: string, message: string) {
5656 error . message = message ;
5757 return error ;
5858}
59-
60- export const toTitleLc = ( title : string ) =>
61- title . toLowerCase ( ) . replaceAll ( " " , "_" ) ;
62- export const encodeTitle = ( title : string ) =>
63- title . replaceAll ( " " , "_" ) . replace (
64- / [ / ? # \{ } ^ | < > ] / g,
65- ( char ) => encodeURIComponent ( char ) ,
66- ) ;
You can’t perform that action at this time.
0 commit comments