function addComment(name, content, blobKey) {
  const target = document.getElementById('prior-comments');
  let newComment = document.createElement('div');
  newComment.className = 'comment-full';
  // add an image to the comment only if image is defined
  if (blobKey !== undefined) {
    let img = newComment.appendChild(document.createElement('img'));
    img.className = 'comment-img';
    img.src = '/serve?blob-key=' + blobKey;
  }
  let body = newComment.appendChild(document.createElement('div'));
  body.className = 'comment-body';
  let user = newComment.appendChild(document.createElement('div'));
  user.className = 'sub-script';
  // We need to make sure to strip comments of any special chars they may have
  // in order to prevent injection attacks.
  user.innerText = '-' + sanitizeHtml(/* str= */ name);
  body.innerText = sanitizeHtml(/* str= */ content);

  target.appendChild(newComment);
}
/**
 * Creates divs for a new comment, intended to be called by
 * loadComments.
 * @param {string} name The name of the user who made the comment
 * @param {string} content The body of the comment
 * @param {string} blobKey The blobKey of an image to add to the comment, this
 *     may be undefined
 */
Creates divs for a new comment, intended to be called by
loadComments.
@param {string} name The name of the user who made the comment
@param {string} content The body of the comment
@param {string} blobKey The blobKey of an image to add to the comment, this
may be undefined
Creates divs for a new comment intended to be called by loadComments . @param { string } name The name of the user who made the comment @param { string } content The body of the comment @param { string } blobKey The blobKey of an image to add to the comment this may be undefined
function addComment(name, content, blobKey) {
  const target = document.getElementById('prior-comments');
  let newComment = document.createElement('div');
  newComment.className = 'comment-full';
  if (blobKey !== undefined) {
    let img = newComment.appendChild(document.createElement('img'));
    img.className = 'comment-img';
    img.src = '/serve?blob-key=' + blobKey;
  }
  let body = newComment.appendChild(document.createElement('div'));
  body.className = 'comment-body';
  let user = newComment.appendChild(document.createElement('div'));
  user.className = 'sub-script';
  user.innerText = '-' + sanitizeHtml( name);
  body.innerText = sanitizeHtml( content);
  target.appendChild(newComment);
}
function addComment ( name , content , blobKey ) { const target = document . getElementById ( 'prior-comments' ) ; let newComment = document . createElement ( 'div' ) ; newComment . className = 'comment-full' ; if ( blobKey !== undefined ) { let img = newComment . appendChild ( document . createElement ( 'img' ) ) ; img . className = 'comment-img' ; img . src = '/serve?blob-key=' + blobKey ; } let body = newComment . appendChild ( document . createElement ( 'div' ) ) ; body . className = 'comment-body' ; let user = newComment . appendChild ( document . createElement ( 'div' ) ) ; user . className = 'sub-script' ; user . innerText = '-' + sanitizeHtml ( name ) ; body . innerText = sanitizeHtml ( content ) ; target . appendChild ( newComment ) ; }
Creates divs for a new comment, intended to be called by
 loadComments.
Creates divs for a new comment intended to be called by loadComments .
// add an image to the comment only if image is defined // We need to make sure to strip comments of any special chars they may have // in order to prevent injection attacks. /* str= */ /* str= */