Dominic Ricottone
"; } { if (ignore==0) { gsub("&","\\&"); gsub("'","\\’"); $0 = gensub(/\[([^\]]+)\]\(([^\)]+)\)/, "\\1", "g"); if ($0 ~ /^## /) { if (in_paragraph==1) end_paragraph(); if (in_subbullets==1) end_subbullets(); if (in_bullets==1) end_bullets(); if (in_subsection==1) end_subsection(); if (in_section==1) end_section(); print "" substr($0,4) "
"; } # start of a section (which is a pair of a paragraph and an unordered list) else if ($0 ~ /^### /) { if (in_paragraph==1) end_paragraph(); if (in_subbullets==1) end_subbullets(); if (in_bullets==1) end_bullets(); if (in_subsection==1) end_subsection(); if (in_section==1) end_section(); print "" substr($0,5) "
"; in_section=1; } # start of a subsection (which is a list item) else if ($0 ~ /^ \+ #### /) { if (in_paragraph==1) end_paragraph(); if (in_subbullets==1) end_subbullets(); if (in_bullets==1) end_bullets(); if (in_subsection==1) end_subsection(); else print "- ";
print "
- ";
print "
" substr($0,9) "
"; in_subsection=1; } # bullets (may be start of or a member of) else if ($0 ~ /^ \+ /) { if (in_paragraph==1) end_paragraph(); if (in_subbullets==1) end_subbullets(); if (in_bullets==0) print "- ";
sub(/ +\+ /,"");
print "
- " $0 " "; in_bullets=1; } # subbullets (may be start of or a member of) else if ($0 ~ /^ \+ /) { if (in_paragraph==1) end_paragraph(); if (in_subbullets==0) print "
- " $0 " "; in_subbullets=1; } # blank line (end of paragraphs) else if ($0 ~ /^$/) { if (in_paragraph==1) end_paragraph(); if (in_subbullets==1) end_subbullets(); if (in_bullets==1) end_bullets(); } # horizontal rules (also end of paragraphs) else if ($0 ~ /^-----+$/) { if (in_paragraph==1) end_paragraph(); if (in_subbullets==1) end_subbullets(); if (in_bullets==1) end_bullets(); if (in_subsection==1) end_subsection(); if (in_section==1) end_section(); print "
- ";
sub(/ +\+ /,"");
print "
"; } # paragraphs else { sub(/^ *\*/,""); sub(/\*$/,""); if (in_paragraph==0) print "" $0; else print $0; in_paragraph=1; } } else if ($0 ~ /Ignore above content for PDF and HTML versions/) ignore=0; } END { if (in_paragraph==1) end_paragraph(); if (in_subbullets==1) end_subbullets(); if (in_bullets==1) end_bullets(); if (in_subsection==1) end_subsection(); if (in_section==1) end_section(); print "