Created
September 25, 2017 01:55
-
-
Save retrography/1499a6b6617942c3c3a4c8600af5a058 to your computer and use it in GitHub Desktop.
Parses the reference from the clipboard using AnyStyle parser and returns the corresponding bibtex record back into the clipboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Encoding.default_external='utf-8' | |
Encoding.default_internal='utf-8' | |
require 'anystyle/parser' | |
require 'clipboard' | |
text = Clipboard.paste.tr("\n\r", " ").gsub(/\s+/,' ').gsub(/([a-zA-Z])- ([a-zA-Z])/, '\1\2') | |
ref = Anystyle.parse(text, :bibtex).to_s | |
Clipboard.copy(ref) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment