polacode icon indicating copy to clipboard operation
polacode copied to clipboard

JSDoc comments get messed up

Open AustinGil opened this issue 5 years ago • 2 comments

I love this extension. Thank you so much for making it.

One issue I've noticed is that for JavaScript code, sometimes the JSDoc blocks get messed up when generating the image.

My code example is this, but something about the curly braces in the comments is off and they get shifted.

/**
 * @param {string | number | Date} date
 * @param {Intl.DateTimeFormatOptions} [options]
 * @param {string | string[]} [locales]
 * @returns {string}
 */
function formatDate(date, options, locales) {
  date = new Date(date);
  options = options || { day: 'numeric', month: 'short', year: 'numeric' };
  locales = locales || navigator.language;

  return new Intl.DateTimeFormat(locales, options).format(date);
}

AustinGil avatar Nov 07 '20 03:11 AustinGil

i had that problem too.i tried few things and somehow it worked.I hope this will help you. issue- https://github.com/octref/polacode/issues/149

MasterBrian99 avatar Nov 09 '20 16:11 MasterBrian99

Thanks @MasterBrian99. I wonder what causes the issue.

AustinGil avatar Nov 09 '20 17:11 AustinGil