summaryrefslogtreecommitdiff
path: root/smu.c
diff options
context:
space:
mode:
Diffstat (limited to 'smu.c')
-rw-r--r--smu.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/smu.c b/smu.c
index cf82578..a955d69 100644
--- a/smu.c
+++ b/smu.c
@@ -127,6 +127,23 @@ doamp(const char *begin, const char *end, int newblock) {
unsigned int
dogtlt(const char *begin, const char *end, int newblock) {
+ int brpos;
+ char c;
+
+ if(nohtml || begin + 1 >= end)
+ return 0;
+ brpos = begin[1] == '>';
+ if(!brpos && *begin != '<')
+ return 0;
+ c = begin[brpos ? 0 : 1];
+ if(!brpos && (c < 'a' || c > 'z') && (c < 'A' || c > 'Z')) {
+ fputs("&lt;",stdout);
+ return 1;
+ }
+ else if(brpos && (c < 'a' || c > 'z') && (c < 'A' || c > 'Z') && !strchr("/\"'",c)) {
+ printf("%c&gt;",c);
+ return 2;
+ }
return 0;
}