 
     @add({name: 'timestamp', value: Translator.testmode_timestamp || @item.dateModified || @item.dateAdded})
 
+    if @item.extra
+      fields = []
+
+      extra = []
+      for line in @item.extra.split("\n")
+        m = /^\s*(LCCN|MR|Zbl|PMCID|PMID|arXiv|JSTOR|HDL|GoogleBooksID)\s*:\s*([\S]+)\s*$/i.exec(line)
+        name = m?[1].toLowerCase()
+        Translator.log("fixed field #{name} = #{m[2]}") if name
+        switch name
+          when 'mr'
+            fields.push({ name: 'mrnumber', value: m[2] })
+          when 'zbl'
+            fields.push({ name: 'zmnumber', value: m[2] })
+          when 'lccn', 'pmcid'
+            fields.push({ name: name, value: m[2] })
+          when 'pmid', 'arxiv', 'jstor', 'hdl'
+            fields.push({ name: 'eprinttype', value: m[1].toLowerCase() })
+            fields.push({ name: 'eprint', value: m[2] })
+          when 'googlebooksid'
+            fields.push({ name: 'eprinttype', value: 'googlebooks' })
+            fields.push({ name: 'eprint', value: m[2] })
+
+          else extra.push(line)
+      @item.extra = extra.join("\n")
+
+      m = /(biblatexdata|bibtex|biblatex)\[([^\]]+)\]/.exec(@item.extra)
+      if m
+        @item.extra = @item.extra.replace(m[0], '').trim()
+        for assignment in m[2].split(';')
+          data = assignment.match(/^([^=]+)=\s*(.*)/)
+          unless data
+            Zotero.debug("Not an assignment: #{assignment}")
+            continue
+
+          fields.push({ name: data[1], value: data[2] })
+
+      m = /(biblatexdata|bibtex|biblatex)({[\s\S]+})/.exec(@item.extra)
+      if m
+        prefix = m[1]
+        data = m[2]
+        while data.indexOf('}') >= 0
+          try
+            json = JSON5.parse(data)
+          catch
+            json = null
+          break if json
+          data = data.replace(/[^}]*}$/, '')
+        if json
+          @item.extra = @item.extra.replace(prefix + data, '').trim()
+          for name, value of json
+            fields.push({name: name, value: value})
+
+      for field in fields
+        if field.name == 'referencetype'
+          @itemtype = field.value
+          continue
+
+        field = @field(Translator.BibLaTeXDataFieldMap[field.name], field.value) if Translator.BibLaTeXDataFieldMap[field.name]
+        field.noreplace = true
+        @add(field)
+
 Reference::log = Translator.log
 
 Reference::field = (f, value) ->

  return if typeof field.value != 'number' and not field.value
  return if typeof field.value == 'string' and field.value.trim() == ''
  return if Array.isArray(field.value) and field.value.length == 0

  @remove(field.name) if field.replace
  throw "duplicate field '#{field.name}' for #{@item.__citekey__}" if @has[field.name] && !field.allowDuplicates

Reference::normalize = (typeof (''.normalize) == 'function')

Reference::complete = ->
  @add({name: 'type', value: @itemtype}) if @fields.length == 0

  if Translator.DOIandURL != 'both'
