@@ -70,25 +70,23 @@ function downloadThread({ as = Format.PNG } = {}) {
7070 const pixelRatio = window . devicePixelRatio ;
7171 const minRatio = as === Format . PDF ? 2 : 2.5 ;
7272 window . devicePixelRatio = Math . max ( pixelRatio , minRatio ) ;
73- html2canvas ( elements . thread ,
74- {
75- letterRendering : true ,
76- onclone : function ( cloneDoc ) {
77- //Make small fix of position to all the text containers
78- let listOfTexts = cloneDoc . getElementsByClassName ( 'min-h-[20px]' ) ;
79- Array . from ( listOfTexts ) . forEach ( ( text ) => {
80- text . style . position = 'relative' ;
81- text . style . top = '-8px' ;
82- } ) ;
83-
84- //Delete copy button from code blocks
85- let listOfCopyBtns = cloneDoc . querySelectorAll ( 'button.flex' ) ;
86- Array . from ( listOfCopyBtns ) . forEach (
87- ( btn ) => ( btn . remove ( ) )
88- ) ;
89- }
90- }
91- ) . then ( async function ( canvas ) {
73+ html2canvas ( elements . thread , {
74+ letterRendering : true ,
75+ onclone : function ( cloneDoc ) {
76+ //Make small fix of position to all the text containers
77+ let listOfTexts = cloneDoc . getElementsByClassName ( "min-h-[20px]" ) ;
78+ Array . from ( listOfTexts ) . forEach ( ( text ) => {
79+ text . style . position = "relative" ;
80+ text . style . top = "-8px" ;
81+ } ) ;
82+
83+ //Delete copy button from code blocks
84+ let listOfCopyBtns = cloneDoc . querySelectorAll ( "button.flex" ) ;
85+ Array . from ( listOfCopyBtns ) . forEach (
86+ ( btn ) => ( btn . style . visibility = "hidden" )
87+ ) ;
88+ } ,
89+ } ) . then ( async function ( canvas ) {
9290 elements . restoreLocation ( ) ;
9391 window . devicePixelRatio = pixelRatio ;
9492 const imgData = canvas . toDataURL ( "image/png" ) ;
0 commit comments