import { commentHrefToIds } from '../../commentHrefToIds' ; import { escapeHTML } from './escapeHTML' ; import { timestampToDateDivHTML } from './timestampToDateDivHTML' ; export const makeTr = ( savedComment , isTrailing ) => { const { questionTitle , commentHTML , commentHref , timestamp , } = savedComment ; const tr = document . createElement ( 'tr' ) ; if ( isTrailing ) { tr . setAttribute ( 'data-cpuserscript-unverified-trailing-row' , '' ) ; } tr . setAttribute ( 'class' , '' ) ; const partialHref = commentHref . match ( /\/questions.+/ ) ! [ 0 ] ; const { postId } = commentHrefToIds ( commentHref ) ; tr . dataset . postid = String ( postId ) ; const dateDivHTML = timestampToDateDivHTML ( timestamp ) ; tr . innerHTML = `
    <td>
        ${ dateDivHTML }
    </td>
    <td>comment</td>
    <td>
        <b><a href="${ partialHref }" class="answer-hyperlink timeline-answers">${ escapeHTML ( questionTitle ) }</a></b>
        <br>
        <span class="comments">${ commentHTML }</span>
    </td>
    ` ; return tr ; } ;