diff options
-rw-r--r-- | desktop/selection.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/desktop/selection.c b/desktop/selection.c index 6679be6bc..436117a89 100644 --- a/desktop/selection.c +++ b/desktop/selection.c @@ -747,7 +747,8 @@ static bool selection_copy_handler(const char *text, size_t length, struct box *box, void *handle, const char *whitespace_text, size_t whitespace_length) { - bool add_space = box != NULL ? box->space != 0 : false; + bool add_space = false; + plot_font_style_t style = *plot_style_font; /* add any whitespace which precedes the text from this box */ if (whitespace_text != NULL && whitespace_length > 0) { @@ -757,6 +758,19 @@ static bool selection_copy_handler(const char *text, size_t length, } } + if (box != NULL) { + /* HTML */ + add_space = (box->space != 0); + + if (box->style != NULL) { + /* Override default font style */ + font_plot_style_from_css(box->style, &style); + } else { + /* If there's no style, there must be no text */ + assert(box->text == NULL); + } + } + /* add the text from this box */ if (!gui_add_to_clipboard(text, length, add_space)) return false; |