projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4df5f56
)
Tried to add a few style thingies back into the renderer
author
Art Cancro
<ajc@citadel.org>
Wed, 21 Sep 2022 23:13:45 +0000
(19:13 -0400)
committer
Art Cancro
<ajc@citadel.org>
Wed, 21 Sep 2022 23:13:45 +0000
(19:13 -0400)
libcitadel/lib/html_to_ascii.c
patch
|
blob
|
history
diff --git
a/libcitadel/lib/html_to_ascii.c
b/libcitadel/lib/html_to_ascii.c
index 2d604ac4fa3ab250519e022fca2d988f8bf3aaaf..33373c19d3c44cd4f75a28d2a457f09ba3d3e12c 100644
(file)
--- a/
libcitadel/lib/html_to_ascii.c
+++ b/
libcitadel/lib/html_to_ascii.c
@@
-185,34
+185,52
@@
char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int ansi)
strcat(outbuf, nl);
}
strcat(outbuf, nl);
}
-#if 0
- These seemed like a good idea at the time, but it just makes a mess.
-
else if (
(!strcasecmp(tag, "B"))
else if (
(!strcasecmp(tag, "B"))
- || (!strcasecmp(tag, "/B"))
|| (!strcasecmp(tag, "STRONG"))
|| (!strcasecmp(tag, "STRONG"))
+ ) {
+ if (ansi) {
+ strcat(outbuf, "\033[1m");
+ }
+ }
+ else if (
+ (!strcasecmp(tag, "/B"))
|| (!strcasecmp(tag, "/STRONG"))
) {
|| (!strcasecmp(tag, "/STRONG"))
) {
- strcat(outbuf, "*");
+ if (ansi) {
+ strcat(outbuf, "\033[22m");
+ }
}
else if (
(!strcasecmp(tag, "I"))
}
else if (
(!strcasecmp(tag, "I"))
- || (!strcasecmp(tag, "/I"))
|| (!strcasecmp(tag, "EM"))
|| (!strcasecmp(tag, "EM"))
- || (!strcasecmp(tag, "/EM"))
) {
) {
- strcat(outbuf, "/");
+ if (ansi) {
+ strcat(outbuf, "\033[3m");
+ }
}
else if (
}
else if (
- (!strcasecmp(tag, "
U
"))
- || (!strcasecmp(tag, "/
U
"))
+ (!strcasecmp(tag, "
/I
"))
+ || (!strcasecmp(tag, "/
EM
"))
) {
) {
- strcat(outbuf, "_");
+ if (ansi) {
+ strcat(outbuf, "\033[23m");
+ }
+ }
+
+ else if (!strcasecmp(tag, "U")) {
+ if (ansi) {
+ strcat(outbuf, "\033[4m");
+ }
+ }
+
+ else if (!strcasecmp(tag, "/U")) {
+ if (ansi) {
+ strcat(outbuf, "\033[24m");
+ }
}
}
-#endif
else if (!strcasecmp(tag, "BR")) {
strcat(outbuf, nl);
else if (!strcasecmp(tag, "BR")) {
strcat(outbuf, nl);