automatic <sub>opt</sub>
[c-standard] / ann2html.sh
index 500e36a..8999198 100755 (executable)
@@ -211,6 +211,11 @@ seencontents && !seenfore && /^[^@]/ {
        }
        s = p s
        p = ""
+       # TODO: false positives..
+       while (match(s, /[a-z]opt[ )]/))
+               s = substr(s,1,RSTART) "<sub>opt</sub>" substr(s,RSTART+RLENGTH-1)
+       if (match(s, /[a-z]opt$/))
+               s = substr(s,1,RSTART) "<sub>opt</sub>"
        for (;;) {
                while (match(s, noteid-1 "\\)")) {
                        p = p substr(s,1,RSTART-1)