原创组员
性别保密
在线时间 小时
最后登录1970-1-1
|
今天发现EmEditor宏--中华太阳系联盟版的 标题前后插入半角空格(第一章) → ( 第一章 )只能处理999章,
case 117: //标题章节前后插入一个半角空格
var title=prompt("请输入标题的表达式或(.*关键词.*)(可修改默认标题表达式)","第[0-9一二三四五六七八九十两百零〇]{1,5}[册集部卷章节回]")
if (title!="")
{
document.selection.Replace("("+title+")"," \\1 ",nFlags);
document.selection.Replace("[ ]+("+title+")[ ]+"," \\1 ",nFlags);
document.selection.Replace("^[ ]+","",nFlags);
}
break;
标题前插入二三个空行也只能处理999章。
case 132:///标题前插入三个空行
var title=prompt("输入标题表达式或关键词,已含“作品相关”等标题。","第[0-9一二三四五六七八九十两百零〇]{1,5}[册集部卷章节回]")
if (title!="")
{
bAnswer = confirm("按确定插入三个空行,按取消只插入两个空行。");
if (bAnswer==true)
{
document.selection.Replace("^([^ ]*"+title+")","\\n\\n\\n\\1",nFlags);
document.selection.Replace("^[ ]+([^ ]*"+title+")","\\n\\n\\n\\1",nFlags);
document.selection.Replace("^[ ]*正文","\\n\\n\\n正文",nFlags);
document.selection.Replace("^[ ]*作品相关","\\n\\n\\n作品相关",nFlags);
document.selection.Replace("^[ ]*序","\\n\\n\\n序",nFlags);
document.selection.Replace("^[ ]*前言","\\n\\n\\n前言",nFlags);
document.selection.Replace("^[ ]*后记","\\n\\n\\n后记",nFlags);
document.selection.Replace("^[ ]*引子","\\n\\n\\n引子",nFlags);
document.selection.Replace("^[ ]*楔","\\n\\n\\n楔",nFlags);
}
else
{
document.selection.Replace("^([^ ]*"+title+")","\\n\\n\\1",nFlags);
document.selection.Replace("^[ ]+([^ ]*"+title+")","\\n\\n\\1",nFlags);
document.selection.Replace("^[ ]*正文","\\n\\n正文",nFlags);
document.selection.Replace("^[ ]*作品相关","\\n\\n作品相关",nFlags);
document.selection.Replace("^[ ]*序","\\n\\n序",nFlags);
document.selection.Replace("^[ ]*引子","\\n\\n引子",nFlags);
document.selection.Replace("^[ ]*前言","\\n\\n前言",nFlags);
document.selection.Replace("^[ ]*后记","\\n\\n后记",nFlags);
document.selection.Replace("^[ ]*楔","\\n\\n楔",nFlags);
}
}
break;
请问怎么修改才能处理几千章? |
插件设计: zasq.net
|