version 1.57, 2019/05/01 17:20:47 |
version 1.60, 2019/05/07 23:41:48 |
Line 97 static const struct alias aliases[] = { |
|
Line 97 static const struct alias aliases[] = { |
|
{ "imageobject", NODE_IGNORE }, |
{ "imageobject", NODE_IGNORE }, |
{ "indexterm", NODE_DELETE }, |
{ "indexterm", NODE_DELETE }, |
{ "informaltable", NODE_TABLE }, |
{ "informaltable", NODE_TABLE }, |
|
{ "jobtitle", NODE_IGNORE }, |
{ "keycap", NODE_KEYSYM }, |
{ "keycap", NODE_KEYSYM }, |
{ "keycode", NODE_IGNORE }, |
{ "keycode", NODE_IGNORE }, |
{ "keycombo", NODE_IGNORE }, |
{ "keycombo", NODE_IGNORE }, |
{ "mediaobject", NODE_BLOCKQUOTE }, |
{ "mediaobject", NODE_BLOCKQUOTE }, |
|
{ "orgdiv", NODE_IGNORE }, |
{ "orgname", NODE_IGNORE }, |
{ "orgname", NODE_IGNORE }, |
{ "othercredit", NODE_AUTHOR }, |
{ "othercredit", NODE_AUTHOR }, |
{ "othername", NODE_PERSONNAME }, |
{ "othername", NODE_PERSONNAME }, |
Line 354 pnode_closetext(struct parse *p, int check_last_word) |
|
Line 356 pnode_closetext(struct parse *p, int check_last_word) |
|
|
|
while (cp > n->b && !isspace((unsigned char)cp[-1])) |
while (cp > n->b && !isspace((unsigned char)cp[-1])) |
cp--; |
cp--; |
|
last_word = cp; |
|
while (cp > n->b && isspace((unsigned char)cp[-1])) |
|
cp--; |
if (cp == n->b) |
if (cp == n->b) |
return; |
return; |
|
*cp = '\0'; |
|
|
last_word = cp; |
|
while (cp > n->b && isspace((unsigned char)cp[-1])) |
|
*--cp = '\0'; |
|
|
|
/* Move the last word into its own node, for use with .Pf. */ |
/* Move the last word into its own node, for use with .Pf. */ |
|
|
n = pnode_alloc_text(p->cur, last_word); |
n = pnode_alloc_text(p->cur, last_word); |
Line 374 xml_entity(struct parse *p, const char *name) |
|
Line 376 xml_entity(struct parse *p, const char *name) |
|
struct pnode *n; |
struct pnode *n; |
const char *ccp; |
const char *ccp; |
char *cp; |
char *cp; |
unsigned int codepoint; |
long codepoint; |
enum pstate pstate; |
enum pstate pstate; |
|
|
if (p->del > 0) |
if (p->del > 0) |
Line 419 xml_entity(struct parse *p, const char *name) |
|
Line 421 xml_entity(struct parse *p, const char *name) |
|
} |
} |
} |
} |
if (*name == '#') { |
if (*name == '#') { |
codepoint = strtonum(name + 1, 0, 0x10ffff, &ccp); |
errno = 0; |
if (ccp == NULL) { |
if (name[1] == 'x') { |
|
ccp = name + 2; |
|
codepoint = strtol(ccp, &cp, 16); |
|
} else { |
|
ccp = name + 1; |
|
codepoint = strtol(ccp, &cp, 10); |
|
} |
|
if (*ccp != '\0' && *cp == '\0' && errno != ERANGE && |
|
codepoint >= 0 && codepoint <= 0x10ffff) { |
n = pnode_alloc(p->cur); |
n = pnode_alloc(p->cur); |
xasprintf(&n->b, "\\[u%4.4X]", codepoint); |
xasprintf(&n->b, "\\[u%4.4X]", codepoint); |
goto done; |
goto done; |