Skip to content

Copy entry preview should copy real HTML #13041

@koppor

Description

@koppor

This is a follow up to #12576 and a real fix for #12551.

Example entry preview - based on Chocolate.bib; Richard_2017:

Image

I press "copy citation (html)":

Image

Then following HTML is in the clipboard:

<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8">
   </head>
   <body>

 Article (Richard_2017)
Richard, Anna / Meule, Adrian / Friese, Malte / Blechert, Jens

Effects of Chocolate Deprivation on Implicit and Explicit Evaluation of Chocolate in High and Low Trait Chocolate Cravers 
2017-09


Frontiers in Psychology  , Vol. 8


Frontiers Media SA





 
   </body>
</html>

All highlithing lost.

Reason: org.jabref.gui.preview.PreviewViewer#copyPreviewHtmlToClipBoard calls getTextContent. -- This implementation should be changed to use the same functionality as "Copy Preview" of the main table.

Image


The main table copy works correct

Paste result in word:

Image


Hint: org.jabref.gui.preview.CopyCitationAction should be used. - see org.jabref.gui.maintable.RightClickMenu how to initialize; maybe they can be stored globally. Check how it is done in other places of JabRef.

The code uses org.jabref.gui.preview.ClipboardContentGenerator#generateCitations to generate the HTML.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for feature.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions