//////////////////////////////////////////////////////////// // validateh.mac // Toshiyuki Akutsu // Mon, 20 Dec 1999 21:30:54 //////////////////////////////////////////////////////////// openreg "CURRENTUSER", "Software\\Hidemaruo\\Hidemaru\\Env"; if( ! result ) endmacro; $__macroPath = getregstr( "MacroPath" ); closereg; if( $__macroPath == "" ) $__macroPath = hidemarudir; if( rightstr( $__macroPath, 1 ) != "\\" ) $__macroPath = $__macroPath + "\\"; $__INI = $__macroPath + "csshtml\\csshtml.ini"; //////////////////////////////////////////////////////////// writeininum $__INI,"SUBMACRO","SUCCESS",0; #__INTERVAL = getininum($__INI,"CSSHTML","__INTERVAL"); #__NAMEMAX = getininum($__INI,"CSSHTML","__NAMEMAX"); #__DQUOT = getininum($__INI,"CSSHTML","__DQUOT"); #__PRE = getininum($__INI,"CSSHTML","__PRE"); #__CR = getininum($__INI,"CSSHTML","__CR"); #__ANCHOR = getininum($__INI,"CSSHTML","__ANCHOR"); $__TIME = getinistr($__INI,"CSSHTML","__TIME"); if( #__DQUOT ) $__Q = "\""; else $__Q = "'"; //////////////////////////////////////////////////////////// disableinvert; disabledraw; escape; title "1/16 &"; replaceallfast "&", "&"; title "2/16 <"; replaceallfast "<", "<"; title "3/16 >"; replaceallfast ">", ">"; title "4/16 ""; replaceallfast "\"", """; if( #__CR ){ title "5/16 cr"; $$tmp = ""; replaceallfast "\\n", $$tmp + "↓\\n", regular; replaceallfast "\\n" + $$tmp, "\\n", regular; } if( #__ANCHOR ) call insertAnchorAndIndex; if( #__PRE == 0 ){ title "11/16
"; replaceallfast "\\n", "
\\n", regular; } title "12/16 url"; $$sb = "‰℃" + $__TIME + "h11℃‰\\f[^‰]+\\f‰℃" + $__TIME + "/SPAN℃‰"; $$rb = "\\1"; replaceallfast $$sb, $$rb, regular; title "13/16 mailto"; $$sb = "‰℃" + $__TIME + "h12℃‰\\f[^‰]+\\f‰℃" + $__TIME + "/SPAN℃‰"; $$rb = "\\1"; replaceallfast $$sb, $$rb, regular; //残りの全てを有効にする。 title "14/16 validate 1"; $$sb = "‰℃" + $__TIME + "\\fh[0-9][0-9]\\f℃‰"; $$rb = ""; replaceallfast $$sb, $$rb, regular; title "15/16 validate 2"; replaceallfast "‰℃" + $__TIME + "/SPAN℃‰", "", casesense; //後は、ボディ。 title "wait a moment..."; gofileend; if( #__PRE ) insert "\n"; insert "\n\n\n"; gofiletop; insert "\n\n\n"; $$tmp = getinistr($__INI,"CSSHTML","GENERATOR"); insert " " + $$tmp + "\n"; insert " " + leftstr(basename2,strlen(basename2)-4) + "\n"; // STYLE insert " \n\n"; // END STYLE insert "\n"; if( #__PRE ) insert "
\n";
	gofiletop;

	clearcliphist; setclipboard "";
	title 0;
	writeininum $__INI,"SUBMACRO","SUCCESS",1;

endmacro;
// End of validateh.mac
////////////////////////////////////////////////////////////
insertAnchorAndIndex:

//を前に挿入
	##num[0] = -1; ##num[1] = -1; ##num[2] = -1; ##num[3] = -1;
	$$H[0] = "h06"; $$H[1] = "h09"; $$H[2] = "h05"; $$H[3] = "h08";
	$$sH = "h0[";
	if( #__ANCHOR & 0x01 ) $$sH = $$sH + "6";
	if( #__ANCHOR & 0x02 ) $$sH = $$sH + "9";
	if( #__ANCHOR & 0x04 ) $$sH = $$sH + "5";
	if( #__ANCHOR & 0x08 ) $$sH = $$sH + "8";
	$$sH = $$sH + "]";
	$$sb = "‰℃" + $__TIME + $$sH + "℃‰";
	$$ancr = $__Q + ">"; //全共通
	##i = 0;
	while( ##i < 4 ){
		$$ancl[##i] = "";
		##i = ##i + 1;
	}
	gofileend; $$eof = "/" + str(lineno) + " anchor";
	##tickcount = tickcount + 500;
	gofiletop; insertfix "\n"; // ★(1)
	setclipboard "";
	##h = 0;
	searchdown $$sb, regular;
	while( result )
	{
		##ancx = seltopx; ##ancy = seltopy;
		##namex = selendx; ##namey = selendy;
		escape;
		right 17;
		if( code == '6' ) ##h = 0;
		else if( code == '9' ) ##h = 1;
		else if( code == '5' ) ##h = 2;
		else ##h = 3;

		moveto ##namex, ##namey;
		##i = 0;
		while( ##i < #__NAMEMAX ){
			right;
			if( code != 0x81F1 ) ##i = ##i + 1;
			else break;
		}
		$$name = gettext( ##namex, ##namey, x, y );
		##num[##h] = ##num[##h] + 1;
		$$num = rightstr("000"+str(##num[##h]),4);
		addclipboard $$ahref[##h] + $$num + $$class[##h] + $$name + "\n";
		moveto ##ancx, ##ancy;
		insert $$ancl[##h] + $$num + $$ancr;
		if( tickcount > ##tickcount ){
			title str(lineno) + $$eof;
			##tickcount = tickcount + #__INTERVAL;
		}
		finddown;
	}

title "10/16 index";

	$__MK = "‰℃‰℃" + $__TIME + "InDeXeNd℃‰℃‰";
	addclipboard $__MK;
	gofiletop; paste;
	// PasteCursorFix == 0 にしてある。
	gofiletop; right;
	searchup "^" + $__MK, regular;
	if( ! result ){
		gofiletop;
		insertfix "
\n"; searchdown "^" + $__MK, regular; if( result ){ delete; insert "
"; } }else{ delete; delete; } return; // end insertAnchorAndIndex ////////////////////////////////////////////////////////////