octref / polacode

📸 Polaroid for your code
https://marketplace.visualstudio.com/items?itemName=pnp.polacode
6.81k stars 184 forks source link

JSDoc comments get messed up #148

Open AustinGil opened 3 years ago

AustinGil commented 3 years ago

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);
}
MasterBrian99 commented 3 years ago

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

AustinGil commented 3 years ago

Thanks @MasterBrian99. I wonder what causes the issue.