This is a follow up to #12576 and a real fix for #12551.
Example entry preview - based on Chocolate.bib; Richard_2017:

I press "copy citation (html)":

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.

The main table copy works correct
Paste result in word:

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.
This is a follow up to #12576 and a real fix for #12551.
Example entry preview - based on
Chocolate.bib;Richard_2017:I press "copy citation (html)":
Then following HTML is in the clipboard:
All highlithing lost.
Reason:
org.jabref.gui.preview.PreviewViewer#copyPreviewHtmlToClipBoardcallsgetTextContent. -- This implementation should be changed to use the same functionality as "Copy Preview" of the main table.The main table copy works correct
Paste result in word:
Hint:
org.jabref.gui.preview.CopyCitationActionshould 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#generateCitationsto generate the HTML.