From cecf786b0e0d6831ea582ffad650beec673bfb2b Mon Sep 17 00:00:00 2001 From: jonahtanjz Date: Fri, 10 Dec 2021 18:36:16 +0800 Subject: [PATCH] Extract tag for NULL values when copying to clipboard Signed-off-by: jonahtanjz --- js/src/sql.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/src/sql.js b/js/src/sql.js index 5c87fde8e2..cfad2a068b 100644 --- a/js/src/sql.js +++ b/js/src/sql.js @@ -376,7 +376,9 @@ AJAX.registerOnload('sql.js', function () { textArea.value += '\n'; $('.table_results tbody tr').each(function () { $(this).find('.data span').each(function () { - textArea.value += $(this).text() + '\t'; + // Extract tag for NULL values before converting to string to not mess up formatting + var data = $(this).find('em').length !== 0 ? $(this).find('em')[0] : this; + textArea.value += $(data).text() + '\t'; }); textArea.value += '\n'; });