Skip to content

Commit

Permalink
Exercise entities, remove dead function.
Browse files Browse the repository at this point in the history
  • Loading branch information
kristapsdz committed Sep 30, 2024
1 parent f40506b commit 94f2c37
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 44 deletions.
34 changes: 17 additions & 17 deletions coverage-table.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
| Files | Coverage |
|-------|----------|
| autolink.c | 65.73% |
| buffer.c | 71.91% |
| diff.c | 79.40% |
| document.c | 74.01% |
| entity.c | 40.74% |
| gemini.c | 65.91% |
| html.c | 66.51% |
| html_escape.c | 87.65% |
| latex.c | 64.08% |
| library.c | 80.14% |
| libdiff.c | 94.05% |
| nroff.c | 71.38% |
| odt.c | 63.64% |
| smartypants.c | 83.89% |
| term.c | 67.54% |
| tree.c | 34.84% |
| util.c | 6.38% |
| [autolink.c](https://github.com/kristapsdz/lowdown/blob/master/autolink.c) | 65.73% |
| [buffer.c](https://github.com/kristapsdz/lowdown/blob/master/buffer.c) | 71.91% |
| [diff.c](https://github.com/kristapsdz/lowdown/blob/master/diff.c) | 79.40% |
| [document.c](https://github.com/kristapsdz/lowdown/blob/master/document.c) | 81.17% |
| [entity.c](https://github.com/kristapsdz/lowdown/blob/master/entity.c) | 75.31% |
| [gemini.c](https://github.com/kristapsdz/lowdown/blob/master/gemini.c) | 65.91% |
| [html.c](https://github.com/kristapsdz/lowdown/blob/master/html.c) | 74.50% |
| [html_escape.c](https://github.com/kristapsdz/lowdown/blob/master/html_escape.c) | 87.65% |
| [latex.c](https://github.com/kristapsdz/lowdown/blob/master/latex.c) | 64.72% |
| [library.c](https://github.com/kristapsdz/lowdown/blob/master/library.c) | 80.14% |
| [libdiff.c](https://github.com/kristapsdz/lowdown/blob/master/libdiff.c) | 94.05% |
| [nroff.c](https://github.com/kristapsdz/lowdown/blob/master/nroff.c) | 74.28% |
| [odt.c](https://github.com/kristapsdz/lowdown/blob/master/odt.c) | 63.64% |
| [smartypants.c](https://github.com/kristapsdz/lowdown/blob/master/smartypants.c) | 83.89% |
| [term.c](https://github.com/kristapsdz/lowdown/blob/master/term.c) | 67.54% |
| [tree.c](https://github.com/kristapsdz/lowdown/blob/master/tree.c) | 34.84% |
| [util.c](https://github.com/kristapsdz/lowdown/blob/master/util.c) | 56.76% |
1 change: 0 additions & 1 deletion extern.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ int hesc_href(struct lowdown_buf *, const char *, size_t);
int hesc_html(struct lowdown_buf *, const char *, size_t, int, int, int);

char *rcsdate2str(const char *);
char *date2str(const char *);
char *rcsauthor2str(const char *);

#endif /* !EXTERN_H */
1 change: 1 addition & 0 deletions regress/entities.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>a &#8211; b &#8211; c &#8211; a</p>
2 changes: 2 additions & 0 deletions regress/entities.latex
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

a -- b -- c -- a
2 changes: 2 additions & 0 deletions regress/entities.man
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.PP
a \(en b \(en c \(en a
2 changes: 2 additions & 0 deletions regress/entities.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

a &#8211; b &#x2013; c &ndash; a
26 changes: 0 additions & 26 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,29 +114,3 @@ rcsauthor2str(const char *v)

return buf;
}

/*
* Convert an ISO date (y/m/d or y-m-d) to a canonical form.
* Returns NULL if the string is malformed at all or the date otherwise.
*/
char *
date2str(const char *v)
{
unsigned int y, m, d;
int rc;
static char buf[32];

if (NULL == v)
return(NULL);

rc = sscanf(v, "%u/%u/%u", &y, &m, &d);
if (3 != rc) {
rc = sscanf(v, "%u-%u-%u", &y, &m, &d);
if (3 != rc)
return(NULL);
}

snprintf(buf, sizeof(buf), "%u-%.2u-%.2u", y, m, d);
return(buf);
}

0 comments on commit 94f2c37

Please sign in to comment.