@@ -353,23 +353,30 @@ void HtmlDocVisitor::visit(DocEmoji *s)
353353
354354void HtmlDocVisitor::writeObfuscatedMailAddress (const QCString &url)
355355{
356- m_t << " <a href=\" #\" onclick=\" location.href='mai'+'lto:'" ;
357- if (!url.isEmpty ())
356+ if (!Config_getBool (OBFUSCATE_EMAILS))
358357 {
359- const char *p = url.data ();
360- uint size=3 ;
361- while (*p)
358+ m_t << " <a href=\" mailto:" << url << " \" >" ;
359+ }
360+ else
361+ {
362+ m_t << " <a href=\" #\" onclick=\" location.href='mai'+'lto:'" ;
363+ if (!url.isEmpty ())
362364 {
363- m_t << " +'" ;
364- for (uint j=0 ;j<size && *p;j++)
365+ const char *p = url.data ();
366+ uint size=3 ;
367+ while (*p)
365368 {
366- p = writeUTF8Char (m_t ,p);
369+ m_t << " +'" ;
370+ for (uint j=0 ;j<size && *p;j++)
371+ {
372+ p = writeUTF8Char (m_t ,p);
373+ }
374+ m_t << " '" ;
375+ if (size==3 ) size=2 ; else size=3 ;
367376 }
368- m_t << " '" ;
369- if (size==3 ) size=2 ; else size=3 ;
370377 }
378+ m_t << " ; return false;\" >" ;
371379 }
372- m_t << " ; return false;\" >" ;
373380}
374381
375382void HtmlDocVisitor::visit (DocURL *u)
@@ -380,17 +387,24 @@ void HtmlDocVisitor::visit(DocURL *u)
380387 QCString url = u->url ();
381388 // obfuscate the mail address link
382389 writeObfuscatedMailAddress (url);
383- const char *p = url.data ();
384- // also obfuscate the address as shown on the web page
385- uint size=5 ;
386- while (*p)
390+ if (!Config_getBool (OBFUSCATE_EMAILS))
387391 {
388- for (uint j=0 ;j<size && *p;j++)
392+ m_t << url;
393+ }
394+ else
395+ {
396+ const char *p = url.data ();
397+ // also obfuscate the address as shown on the web page
398+ uint size=5 ;
399+ while (*p)
389400 {
390- p = writeUTF8Char (m_t ,p);
401+ for (uint j=0 ;j<size && *p;j++)
402+ {
403+ p = writeUTF8Char (m_t ,p);
404+ }
405+ if (*p) m_t << " <span style=\" display: none;\" >.nosp@m.</span>" ;
406+ if (size==5 ) size=4 ; else size=5 ;
391407 }
392- if (*p) m_t << " <span style=\" display: none;\" >.nosp@m.</span>" ;
393- if (size==5 ) size=4 ; else size=5 ;
394408 }
395409 m_t << " </a>" ;
396410 }
0 commit comments