From ce4b7363932c1152060ba4b24d9a7e7bf438d4e4 Mon Sep 17 00:00:00 2001 From: albert-github Date: Tue, 5 Nov 2019 18:52:56 +0100 Subject: Simple nospam email address When having a simple nospam email address coded like: ``` /** \file * Big Unknown */ ``` this results in the warning: ``` aa.c:2: warning: Unsupported xml/html tag found ``` and in the HTML output it looks like: ``` Big Unknown ``` instead of: ``` Big Unknown ``` (Found in a couple of open source projects). --- src/doctokenizer.l | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 22b14a0..59a0a9d 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -345,6 +345,7 @@ CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?] CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/\?] CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*"\"" MAILADR ("mailto:")?[a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-]+ +MAILADR2 {BLANK}*[a-z_A-Z0-9+-]+({BLANK}*[Dd][Oo][Tt]{BLANK}*[a-z_A-Z0-9+-]+)?{BLANK}*[Aa][Tt]{BLANK}*[a-z_A-Z0-9-]+({BLANK}*[Dd][Oo][Tt]{BLANK}*[a-z_A-Z0-9\-]+)+{BLANK}*[a-z_A-Z0-9\-]+{BLANK}* OPTSTARS ("//"{BLANK}*)?"*"*{BLANK}* LISTITEM {BLANK}*[-]("#")?{WS} MLISTITEM {BLANK}*[+*]{WS} @@ -655,6 +656,10 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} g_token->isEMailAddr=TRUE; return TK_URL; } +"<"{MAILADR2}">" { // anti spame mail address + g_token->name=yytext; + return TK_WORD; + } "$"{ID}":"[^:\n$][^\n$]*"$" { /* RCS tag */ QCString tagName(yytext+1); int index=tagName.find(':'); -- cgit v0.12 From c68ae6ebd44ae66ba35154d868c686cf14c7f6b8 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Wed, 18 Dec 2019 10:17:55 +0100 Subject: Made regexp more strict --- src/doctokenizer.l | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/doctokenizer.l b/src/doctokenizer.l index bf9ccf6..a527672 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -344,8 +344,9 @@ PHPTYPE [\\:a-z_A-Z0-9\x80-\xFF\-]+ CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?] CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/\?] CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*"\"" -MAILADR ("mailto:")?[a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-]+ -MAILADR2 {BLANK}*[a-z_A-Z0-9+-]+({BLANK}*[Dd][Oo][Tt]{BLANK}*[a-z_A-Z0-9+-]+)?{BLANK}*[Aa][Tt]{BLANK}*[a-z_A-Z0-9-]+({BLANK}*[Dd][Oo][Tt]{BLANK}*[a-z_A-Z0-9\-]+)+{BLANK}*[a-z_A-Z0-9\-]+{BLANK}* +MAILADDR ("mailto:")?[a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-]+ +MAILWS [\t a-z_A-Z0-9+-] +MAILADDR2 {MAILWS}+{BLANK}+("at"|"AT"|"_at_"|"_AT_"){BLANK}+{MAILWS}+("dot"|"DOT"|"_dot_"|"_DOT_"){BLANK}+{MAILWS}+ OPTSTARS ("//"{BLANK}*)?"*"*{BLANK}* LISTITEM {BLANK}*[-]("#")?{WS} MLISTITEM {BLANK}*[+*]{WS} @@ -643,20 +644,20 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} g_token->isEMailAddr=FALSE; return TK_URL; } -{MAILADR} { // Mail address +{MAILADDR} { // Mail address g_token->name=yytext; g_token->name.stripPrefix("mailto:"); g_token->isEMailAddr=TRUE; return TK_URL; } -"<"{MAILADR}">" { // Mail address +"<"{MAILADDR}">" { // Mail address g_token->name=yytext; g_token->name = g_token->name.mid(1,g_token->name.length()-2); g_token->name.stripPrefix("mailto:"); g_token->isEMailAddr=TRUE; return TK_URL; } -"<"{MAILADR2}">" { // anti spame mail address +"<"{MAILADDR2}">" { // anti spam mail address g_token->name=yytext; return TK_WORD; } -- cgit v0.12