提交 8e6f63b3 编写于 作者: R rebornix

regex obj is statefull ;(

上级 ab1a9812
......@@ -181,8 +181,8 @@ export function generateCellPath(cell_type: string, cellHandle: number): string
return `/cell_${cellHandle}${cell_type === 'markdown' ? '.md' : ''}`;
}
const regex = new RegExp(/cell_(\d*)(\.)?/g);
export function parseCellHandle(path: string): number | undefined {
const regex = new RegExp(/cell_(\d*)(\.)?/g);
let matches = regex.exec(path);
if (matches && matches.length > 1) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册