/* html2txt2.l flex file for converting html to txt (sort of...) Daniel Scharstein 2/18/08 2nd version - added lists and blank lines */ ws [ \t\n]|" " tag "<"[^>]*">" nltag "<""/"?"h"[1-6]">"|"

"|"
"|""|"" %% int ol = 0; "

    " { ol = 1; } "
" { ol = 0; } "
  • " { if (ol > 0) printf("\n %d. ", ol++); else printf("\n * "); } {nltag} {printf("\n");} {tag} {} {ws}+ {printf(" ");} ">" {printf(">");} "<" {printf("<");} "&" {printf("&");}