/*HTMLSYN -- syntax checker for some pairings in HTML*/
/* David McRitchie -- "The REXX Macros Toolbox" -- 1995/05/25 */
/* http://www.geocities.com/davemcritchie/ */
/*much better check for HTML than EDITPR and PLICHK */
/*recommend QCHK also be used, and finally a real HTML checker*/
Address "ISREDIT";"MACRO"
/* since all are tags -- save time later using FIND NX with bounds*/
"(dataset) = dataset"
"(member) = member"
arg leftside rightside
if "FORCE" /= translate(leftside) then do
ext = right(dataset,4)
if ext /= "HTML" & ext /= ".HTM" & member /= "HTMLSYN.txt" then do;
"x 1 p'=' all"; "line_after 0 = noteline """||,
ext "is not an HTML extension, SYNTAX CHECKING TERMINATED."""
exit 4
end
end
errline = ""
"x 1 p'=' all";"find '<' all";"find '>' all"
bound1=0; bound2=0; col1=0; row1=0; rowa=0; colb=0; row2=0; col2=0;
"bounds"
"(bound1,bound2) = bounds"
say bound1 bound2 dataset
if bound2 > 100 then do
"find first p'^' 101" bound2
if rc \= 0 then "bound 1 100"
end
"(bound1a,bound2a) = bounds"
"line_before .zfirst = noteline",
"""HTMLSYN" time('l') time('r') left(' ',6) "bounds" bound1 bound2,
"(at start)" bound1a bound2a """"
"seek all '""'"
"(seekcnt) = seek_counts";seekcnt=seekcnt+0
if trunc(seekcnt/2) \= seekcnt/2 then
"line_before .zfirst = msgline ""Double quotes found" seekcnt,
"indicates at least one unpaired dquote (QCHK may help)"""
symbols = " AElig Aacute Acirc Agrave Aring Atilde Auml",
"Ccedil ETH Eacute Ecirc Egrave Euml Iacute Icirc Igrave",
"Iuml Ntilde Oacute Ocirc Ograve Oslash Otilde Ouml THORN",
"Uacute Ucirc Ugrave Uuml Yacute aacute acirc aelig",
"agrave aring atilde auml ccedil eacute ecirc egrave eth",
"euml iacute icirc igrave iuml ntilde oacute ocirc ograve",
"oslash otilde ouml szlig thorn uacute ucirc ugrave uuml",
"yacute yuml"
/* see symbols in a table at ...*/
/* http://www.geocities.com/davemcritchie/htm/symbols.htm */
do ttt = 1 to 1;
"find first '
'"
if rc \= 0 then leave ttt
"(row1,col1) = cursor"
"(line) = line" row1
"find first ''"
if rc \= 0 then leave ttt
"(row2,col2) = cursor"
if row1 = row2 then title=substr(line,col1+7,col2-col1-7)
else do
title = substr(line,col1+7)
do i = row1+1 to row2
if row1 <> row2 then title = title substr(line,1,col2-1)
else title = title line
end
end
l=0 + length(title)
if l > 65 then
"line_after .zcsr = msgline ""Standards suggest a maximum",
"of 64 bytes in title --" length(title) """"
end; /* ttt */
call badamp
call misuse "href=http:","missing double quotes after href= when",
"fixed try editpr ="" "">"
call misuse "href='","single quote after href= should be double quote"
call misuse "color=#","double quotes should enclose value for COLOR="
call misuse "bgcolor=#","double quotes should enclose value for BGCOLOR="
call misuse "width=0","double quotes should enclose value for WIDTH="
call misuse "width=1","double quotes should enclose value for WIDTH="
call misuse "width=2","double quotes should enclose value for WIDTH="
call misuse "width=3","double quotes should enclose value for WIDTH="
call misuse "width=4","double quotes should enclose value for WIDTH="
call misuse "width=5","double quotes should enclose value for WIDTH="
call misuse "width=6","double quotes should enclose value for WIDTH="
call misuse "width=7","double quotes should enclose value for WIDTH="
call misuse "width=8","double quotes should enclose value for WIDTH="
call misuse "width=9","double quotes should enclose value for WIDTH="
call misuse "dxxd","unchanged original skeleton code remaining"
call misuse "'>","single quote before > should be double quote"
call misuse "//lycos","possible misuse s/b",
"like http://lycos.cs.cmu.edu or",
"query6.lycos.cs.edu/lycos-form.html"
/* has not really been dropped but validators are still flagging*/
/*--call f curs "&"","" -- accidentally dropped from HTML",
"3.2 lang -- use "" --*/
call occurs "& ."," . -- needs semi-colon not period."
call occurs "&"e",""e -- drop the e -- should be ""
call occurs "&  ","  -- needs semi-colon after  "
call occurs "&" ","" -- needs semi-color after ""
call occurs "ÿ", "hex FF -- found in coding, probably want blanks"
"seek last ""