Skip to content

markdown bug: TypeError: Cannot read property 'replace' of undefined #3091

@MoOx

Description

@MoOx

Prettier from git c0aaa0f

Input:
https://raw.githubusercontent.com/putaindecode/putaindecode.io/18142bb8e0f638e661ba6dafaab633cb65b5847a/content/fr/evenements/2014/05/table-ronde-3/index.md

Expected behavior:

formating should not throw

[error] content/fr/evenements/2014/05/table-ronde-3/index.md: TypeError: Cannot read property 'replace' of undefined
[error]     at Object.getStringWidth (~/node_modules/prettier/src/util.js:746:27)
[error]     at currentWidths.map (~/node_modules/prettier/src/printer-markdown.js:346:30)
[error]     at Array.map (<anonymous>)
[error]     at contents.reduce (~/node_modules/prettier/src/printer-markdown.js:345:21)
[error]     at Array.reduce (<anonymous>)
[error]     at printTable (~/node_modules/prettier/src/printer-markdown.js:343:36)
[error]     at genericPrint (~/node_modules/prettier/src/printer-markdown.js:270:14)
[error]     at genericPrint (~/node_modules/prettier/src/printer.js:148:55)
[error]     at comments.printComments.p (~/node_modules/prettier/src/printer.js:4933:14)
[error]     at Object.printComments (~/node_modules/prettier/src/comments.js:1085:19)```

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:markdownIssues affecting Markdownlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions