executablebooks / myst-vs-code

A syntax highlighter for the MyST Markdown format
https://marketplace.visualstudio.com/items?itemName=ExecutableBookProject.myst-highlight
MIT License
35 stars 15 forks source link

Inline roles in tables break markdown preview #23

Closed alissa-huskey closed 2 years ago

alissa-huskey commented 3 years ago

Describe the bug Inline roles in pipeline tables seem to cause the preview engine to freeze.

To Reproduce

  1. Download this file and remove the .txt extension. (Github wouldn't let me upload a .md file.) roles-in-tables-bug.md.txt
  2. Open it in VS Code.
  3. Run the command Markdown: Open Preview to the Side

Expected behavior

The contents of the file should be displayed in a markdown preview on the right side.

Actual behavior:

If the preview has never been loaded for the file, the preview pane remains blank. If the preview has been loaded previously for the same file, it stops updating the new content.

Screenshots

Here is a screenshot with a table including inline roles, where the preview fails to load.

broken-screenshot

Here is a screenshot of the same file, except without the table that has the inline roles.

working-screenshot

Desktop

Additional context

Here is the log output in the Log (Window).

[2021-04-05 12:31:01.964] [renderer1] [error] Cannot read property 'attrPush' of undefined: TypeError: Cannot read property 'attrPush' of undefined
    at Object.exports.addAttrs (~/.vscode/extensions/jebbs.markdown-extended-1.0.19/node_modules/markdown-it-attrs/utils.js:127:13)
    at Object.transform (~/.vscode/extensions/jebbs.markdown-extended-1.0.19/node_modules/markdown-it-attrs/patterns.js:66:15)
    at Array.curlyAttrs (~/.vscode/extensions/jebbs.markdown-extended-1.0.19/node_modules/markdown-it-attrs/index.js:30:19)
    at a.process (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/markdown-language-features/dist/extension.js:1:142666)
    at h.parse (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/markdown-language-features/dist/extension.js:1:103780)
    at t.MarkdownEngine.tokenizeString (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/markdown-language-features/dist/extension.js:1:97452)
    at t.MarkdownEngine.tokenizeDocument (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/markdown-language-features/dist/extension.js:1:97329)
    at t.MarkdownEngine.parse (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/markdown-language-features/dist/extension.js:1:97850)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at t.default.getRegions (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/markdown-language-features/dist/extension.js:1:62771)
    at async Promise.all (index 0)
    at t.default.provideFoldingRanges (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/markdown-language-features/dist/extension.js:1:62620)
chrisjsewell commented 3 years ago

Just tested this against #30 and the looks to have fixed it 😄