Skip to content

Instantly share code, notes, and snippets.

@ttscoff
Created September 21, 2012 01:11
Show Gist options
  • Save ttscoff/3759232 to your computer and use it in GitHub Desktop.
Save ttscoff/3759232 to your computer and use it in GitHub Desktop.
Replace MMD3 footnote ids and references with unique, timestamp-based references
ARGF.each do |input|
random = Time.now.strftime('%s')
print input.gsub(/(fn(ref)?):(\d+)/, "\\1#{random}-\\3")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment