📄 htmldtd.c
字号:
/* Our Static DTD for HTML** -----------------------*//* Implements:*/#include <HTUtils.h>#include <HTMLDTD.h>#include <LYLeaks.h>#include <LYJustify.h>/* * Character entities like   now excluded from our DTD tables, * they are mapped to Unicode and handled by chartrans code directly * the similar way the numeric entities like { does. * See src/chrtrans/entities.h for real mapping. *//* Entity Names** ------------**** This table must be matched exactly with ALL the translation tables** (this is an obsolete translation mechanism, probably unused,** currently replaced with Unicode chartrans in most cases...)*/static CONST char* entities[] = { "AElig", /* capital AE diphthong (ligature) */ "Aacute", /* capital A, acute accent */ "Acirc", /* capital A, circumflex accent */ "Agrave", /* capital A, grave accent */ "Aring", /* capital A, ring */ "Atilde", /* capital A, tilde */ "Auml", /* capital A, dieresis or umlaut mark */ "Ccedil", /* capital C, cedilla */ "Dstrok", /* capital Eth, Icelandic */ "ETH", /* capital Eth, Icelandic */ "Eacute", /* capital E, acute accent */ "Ecirc", /* capital E, circumflex accent */ "Egrave", /* capital E, grave accent */ "Euml", /* capital E, dieresis or umlaut mark */ "Iacute", /* capital I, acute accent */ "Icirc", /* capital I, circumflex accent */ "Igrave", /* capital I, grave accent */ "Iuml", /* capital I, dieresis or umlaut mark */ "Ntilde", /* capital N, tilde */ "Oacute", /* capital O, acute accent */ "Ocirc", /* capital O, circumflex accent */ "Ograve", /* capital O, grave accent */ "Oslash", /* capital O, slash */ "Otilde", /* capital O, tilde */ "Ouml", /* capital O, dieresis or umlaut mark */ "THORN", /* capital THORN, Icelandic */ "Uacute", /* capital U, acute accent */ "Ucirc", /* capital U, circumflex accent */ "Ugrave", /* capital U, grave accent */ "Uuml", /* capital U, dieresis or umlaut mark */ "Yacute", /* capital Y, acute accent */ "aacute", /* small a, acute accent */ "acirc", /* small a, circumflex accent */ "acute", /* spacing acute */ "aelig", /* small ae diphthong (ligature) */ "agrave", /* small a, grave accent */ "amp", /* ampersand */ "aring", /* small a, ring */ "atilde", /* small a, tilde */ "auml", /* small a, dieresis or umlaut mark */ "brkbar", /* broken vertical bar */ "brvbar", /* broken vertical bar */ "ccedil", /* small c, cedilla */ "cedil", /* spacing cedilla */ "cent", /* cent sign */ "copy", /* copyright sign */ "curren", /* currency sign */ "deg", /* degree sign */ "die", /* spacing dieresis */ "divide", /* division sign */ "eacute", /* small e, acute accent */ "ecirc", /* small e, circumflex accent */ "egrave", /* small e, grave accent */ "emdash", /* dash the width of emsp */ "emsp", /* em space - not collapsed */ "endash", /* dash the width of ensp */ "ensp", /* en space - not collapsed */ "eth", /* small eth, Icelandic */ "euml", /* small e, dieresis or umlaut mark */ "frac12", /* fraction 1/2 */ "frac14", /* fraction 1/4 */ "frac34", /* fraction 3/4 */ "gt", /* greater than */ "hibar", /* spacing macron */ "iacute", /* small i, acute accent */ "icirc", /* small i, circumflex accent */ "iexcl", /* inverted exclamation mark */ "igrave", /* small i, grave accent */ "iquest", /* inverted question mark */ "iuml", /* small i, dieresis or umlaut mark */ "laquo", /* angle quotation mark, left */ "lt", /* less than */ "macr", /* spacing macron */ "mdash", /* dash the width of emsp */ "micro", /* micro sign */ "middot", /* middle dot */ "nbsp", /* non breaking space */ "ndash", /* dash the width of ensp */ "not", /* negation sign */ "ntilde", /* small n, tilde */ "oacute", /* small o, acute accent */ "ocirc", /* small o, circumflex accent */ "ograve", /* small o, grave accent */ "ordf", /* feminine ordinal indicator */ "ordm", /* masculine ordinal indicator */ "oslash", /* small o, slash */ "otilde", /* small o, tilde */ "ouml", /* small o, dieresis or umlaut mark */ "para", /* paragraph sign */ "plusmn", /* plus-or-minus sign */ "pound", /* pound sign */ "quot", /* quote '"' */ "raquo", /* angle quotation mark, right */ "reg", /* circled R registered sign */ "sect", /* section sign */ "shy", /* soft hyphen */ "sup1", /* superscript 1 */ "sup2", /* superscript 2 */ "sup3", /* superscript 3 */ "szlig", /* small sharp s, German (sz ligature) */ "thinsp", /* thin space (not collapsed) */ "thorn", /* small thorn, Icelandic */ "times", /* multiplication sign */ "trade", /* trade mark sign (U+2122) */ "uacute", /* small u, acute accent */ "ucirc", /* small u, circumflex accent */ "ugrave", /* small u, grave accent */ "uml", /* spacing dieresis */ "uuml", /* small u, dieresis or umlaut mark */ "yacute", /* small y, acute accent */ "yen", /* yen sign */ "yuml", /* small y, dieresis or umlaut mark */};/* Attribute Lists** ---------------**** Lists must be in alphabetical order by attribute name** The tag elements contain the number of attributes*/#ifdef USE_PRETTYSRC# define N HTMLA_NORMAL# define i HTMLA_ANAME# define h HTMLA_HREF# define c HTMLA_CLASS# define x HTMLA_AUXCLASS# define T(t) , t#else# define T(t) /*nothing*/#endifstatic attr a_attr[] = { /* Anchor attributes */ { "ACCESSKEY" T(N) }, { "CHARSET" T(N) }, { "CLASS" T(c) }, { "CLEAR" T(N) }, { "COORDS" T(N) }, { "DIR" T(N) }, { "HREF" T(h) }, { "ID" T(i) }, { "ISMAP" T(N) }, { "LANG" T(N) }, { "MD" T(N) }, { "NAME" T(i) }, { "NOTAB" T(N) }, { "ONCLICK" T(N) }, { "ONMOUSEOUT" T(N) }, { "ONMOUSEOVER" T(N) }, { "REL" T(N) }, { "REV" T(N) }, { "SHAPE" T(N) }, { "STYLE" T(N) }, { "TABINDEX" T(N) }, { "TARGET" T(N) }, { "TITLE" T(N) }, { "TYPE" T(N) }, { "URN" T(N) }, { 0 T(N) } /* Terminate list */};static attr address_attr[] = { /* ADDRESS attributes */ { "CLASS" T(c) }, { "CLEAR" T(N) }, { "DIR" T(N) }, { "ID" T(i) }, { "LANG" T(N) }, { "NOWRAP" T(N) }, { "STYLE" T(N) }, { "TITLE" T(N) }, { 0 T(N) } /* Terminate list */};static attr applet_attr[] = { /* APPLET attributes */ { "ALIGN" T(N) }, { "ALT" T(N) }, { "CLASS" T(c) }, { "CLEAR" T(N) }, { "CODE" T(N) }, { "CODEBASE" T(h) }, { "DIR" T(N) }, { "DOWNLOAD" T(N) }, { "HEIGHT" T(N) }, { "HSPACE" T(N) }, { "ID" T(i) }, { "LANG" T(N) }, { "NAME" T(i) }, { "STYLE" T(N) }, { "TITLE" T(N) }, { "VSPACE" T(N) }, { "WIDTH" T(N) }, { 0 T(N) } /* Terminate list */};static attr area_attr[] = { /* AREA attributes */ { "ALT" T(N) }, { "CLASS" T(c) }, { "CLEAR" T(N) }, { "COORDS" T(N) }, { "DIR" T(N) }, { "HREF" T(h) }, { "ID" T(i) }, { "LANG" T(N) }, { "NOHREF" T(N) }, { "NOTAB" T(N) }, { "ONCLICK" T(N) }, { "ONMOUSEOUT" T(N) }, { "ONMOUSEOVER" T(N) }, { "SHAPE" T(N) }, { "STYLE" T(N) }, { "TABINDEX" T(N) }, { "TARGET" T(N) }, { "TITLE" T(N) }, { 0 T(N) } /* Terminate list */};static attr base_attr[] = { /* BASE attributes */ { "HREF" T(h) }, { "TARGET" T(N) }, { "TITLE" T(N) }, { 0 T(N) } /* Terminate list */};static attr bgsound_attr[] = { /* BGSOUND attributes */ { "CLASS" T(c) }, { "CLEAR" T(N) }, { "DIR" T(N) }, { "ID" T(i) }, { "LANG" T(N) }, { "LOOP" T(N) }, { "SRC" T(h) }, { "STYLE" T(N) }, { "TITLE" T(N) }, { 0 T(N) } /* Terminate list */};static attr body_attr[] = { /* BODY attributes */ { "ALINK" T(N) }, { "BACKGROUND" T(h) }, { "BGCOLOR" T(N) }, { "CLASS" T(c) }, { "CLEAR" T(N) }, { "DIR" T(N) }, { "ID" T(i) }, { "LANG" T(N) }, { "LINK" T(N) }, { "ONLOAD" T(N) }, { "ONUNLOAD" T(N) }, { "STYLE" T(N) }, { "TEXT" T(N) }, { "TITLE" T(N) }, { "VLINK" T(N) }, { 0 T(N) } /* Terminate list */};static attr bodytext_attr[] = { /* BODYTEXT attributes */ { "CLASS" T(c) }, { "CLEAR" T(N) }, { "DATA" T(N) }, { "DIR" T(N) }, { "ID" T(i) }, { "LANG" T(N) }, { "NAME" T(N) }, { "OBJECT" T(N) }, { "REF" T(N) }, { "STYLE" T(N) }, { "TITLE" T(N) }, { "TYPE" T(N) }, { "VALUE" T(N) }, { "VALUETYPE" T(N) }, { 0 T(N) } /* Terminate list */};static attr bq_attr[] = { /* BQ (BLOCKQUOTE) attributes */ { "CITE" T(h) }, { "CLASS" T(c) }, { "CLEAR" T(N) }, { "DIR" T(N) }, { "ID" T(i) }, { "LANG" T(N) }, { "NOWRAP" T(N) }, { "STYLE" T(N) }, { "TITLE" T(N) }, { 0 T(N) } /* Terminate list */};static attr button_attr[] = { /* BUTTON attributes */ { "CLASS" T(c) }, { "CLEAR" T(N) }, { "DIR" T(N) }, { "DISABLED" T(N) }, { "ID" T(i) }, { "LANG" T(N) }, { "NAME" T(N) }, { "ONBLUR" T(N) }, { "ONFOCUS" T(N) }, { "STYLE" T(N) }, { "TABINDEX" T(N) }, { "TITLE" T(N) }, { "TYPE" T(N) }, { "VALUE" T(N) }, { 0 T(N) } /* Terminate list */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -