hosseinmd / prettier-plugin-jsdoc

A Prettier plugin to format JSDoc comments.
MIT License
232 stars 28 forks source link

Line breaks are inserted inside a {@link} tag #107

Closed sluukkonen closed 3 years ago

sluukkonen commented 3 years ago

A comment like

/**
 * Calculate the 
 * {@link https://en.wikipedia.org/wiki/Complement_(set_theory)#Relative_complement difference}
 * between two sets.
 */
export function difference<T>(first: Set<T>): (second: Set<T>) => Set<T>

is formatted as

/**
 * Calculate the {@link
 * https://en.wikipedia.org/wiki/Complement_(set_theory)#Relative_complement
 * difference} between two sets.
 */
export function difference<T>(first: Set<T>): (second: Set<T>) => Set<T>

which breaks the rendering in at least Webstorm.

kuva

Configuration:

{
  "semi": false,
  "singleQuote": true,
  "plugins": ["prettier-plugin-jsdoc"],
  "tsdoc": true
}
danielpza commented 3 years ago

for reference thse are the docs https://jsdoc.app/tags-inline-link.html

jaydenseric commented 3 years ago

Some other similar issues…

Markdown links in descriptions are wrapped strangely:

Screen Shot 2021-04-23 at 9 27 06 am

Sometimes it forces a blank space after the opening [:

Screen Shot 2021-04-23 at 9 28 58 am

This also happens for JSDoc links:

Screen Shot 2021-04-23 at 9 26 35 am
hosseinmd commented 3 years ago

Fixed both in chore(release): 0.3.20