Node-red-contrib-static-markdown is reporting TypeError: Cannot read property 'attrJoin' of undefined

node-red-contrib-static-markdown seems to provide the exact functionality I need but I am facing a little issue:

I have cloned the github repository:

so that I can test that the markdown in the example folder docs/test-md-library is properly rendered.

This seems to be the case for the index.md but not for the test.md in same folder.

So this is what I get when navigating to test.md:

same error copy pasted as text:

TypeError: Cannot read property 'attrJoin' of undefined
    at Object.exports.addAttrs (/data/node_modules/@gerhobbelt/markdown-it-attrs/utils.js:105:13)
    at Object.transform (/data/node_modules/@gerhobbelt/markdown-it-attrs/patterns.js:131:15)
    at Array.curlyAttrs (/data/node_modules/@gerhobbelt/markdown-it-attrs/index.js:30:19)
    at Core.process (/data/node_modules/markdown-it/lib/parser_core.js:51:13)
    at MarkdownIt.parse (/data/node_modules/markdown-it/lib/index.js:523:13)
    at MarkdownIt.render (/data/node_modules/markdown-it/lib/index.js:543:36)
    at /data/node_modules/node-red-contrib-static-markdown/nodes/lib/serveMarkdown.js:213:39
    at /data/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)

Note that it seems to be working fine for index.md. So when navigating to http://127.0.0.1:1880/md or http://127.0.0.1:1880/md/index.md : I am seeing the following page:

I think it is a markdown library compatibiity issue that is described in

as I am getting the same error for my file test2.md with following content:

This is a paragraph of text with a *highlighted*{.hi} word in it.

It gives error

TypeError: Cannot read property 'attrJoin' of undefined
    at Object.exports.addAttrs (/data/node_modules/@gerhobbelt/markdown-it-attrs/utils.js:105:13)
    at Object.transform (/data/node_modules/@gerhobbelt/markdown-it-attrs/patterns.js:131:15)
    at Array.curlyAttrs (/data/node_modules/@gerhobbelt/markdown-it-attrs/index.js:30:19)
    at Core.process (/data/node_modules/markdown-it/lib/parser_core.js:51:13)
    at MarkdownIt.parse (/data/node_modules/markdown-it/lib/index.js:523:13)
    at MarkdownIt.render (/data/node_modules/markdown-it/lib/index.js:543:36)
    at /data/node_modules/node-red-contrib-static-markdown/nodes/lib/serveMarkdown.js:213:39
    at /data/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)

I guess/hope this also means that the bulk of the markdown will work and that there is only an issue when using special markdown.

I have also reported this issue in the github repository

... but sofar it is not blocking anything for me. The excellent node provides exactly what I need !

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.