This commit is contained in:
@@ -8,7 +8,7 @@ BEGIN { fn_count = 0 }
|
||||
text = substr($0, id_end + 2)
|
||||
# Trim leading space
|
||||
sub(/^[ \t]+/, "", text)
|
||||
|
||||
|
||||
fn_ids[++fn_count] = id
|
||||
fn_texts[id] = text
|
||||
next
|
||||
@@ -21,19 +21,19 @@ BEGIN { fn_count = 0 }
|
||||
END {
|
||||
for (i = 1; i <= line_count; i++) {
|
||||
line = lines[i]
|
||||
|
||||
|
||||
for (j = 1; j <= fn_count; j++) {
|
||||
id = fn_ids[j]
|
||||
marker = "[^" id "]"
|
||||
repl = "<sup><a href=\"#fn:" id "\" id=\"fnref:" id "\">" id "</a></sup>"
|
||||
|
||||
|
||||
while ((pos = index(line, marker)) > 0) {
|
||||
line = substr(line, 1, pos - 1) repl substr(line, pos + length(marker))
|
||||
}
|
||||
}
|
||||
print line
|
||||
}
|
||||
|
||||
|
||||
if (fn_count > 0) {
|
||||
print "<hr />"
|
||||
print "<section class=\"footnotes\">"
|
||||
|
||||
Reference in New Issue
Block a user