1
0
Fork 0

References in text are now converted into hyperlinks

References are bracketed---they are converted into superscripts. If text
immediately preceeding the reference is bracketed, it is also hyperlinked.
master
Mike Gerwitz 2012-10-09 23:31:40 -04:00
parent 6916c2bfc8
commit 0ea280a430
No known key found for this signature in database
GPG Key ID: F22BB8158EE30EAB
1 changed files with 7 additions and 1 deletions

8
msgfmt
View File

@ -34,8 +34,14 @@ awk '/^diff --git/ { exit } { print }' \
# happen # happen
s#[fh]ttps\?://[^]\n )]\+#<a href="&">&</a>#g; s#[fh]ttps\?://[^]\n )]\+#<a href="&">&</a>#g;
# reference definitions (footnotes)
s#\n\[\([0-9]\+\)\]#</p><p id="ref-\1">&#g;
# references in text
s|\[\([^]]\+\)\]\[\([0-9]\+\)\]|<a href="#ref-\2">\1</a>\[\2\]|g
s|\[\([0-9]\+\)\]|<sup><a href="#ref-\1">&</a></sup>|g
# paragraphs # paragraphs
s#\n\[[0-9]\+\]#</p><p>&#g;
s#\n\n#</p>&<p>#g; s#\n\n#</p>&<p>#g;
# basic formatting # basic formatting