Closed muescha closed 4 years ago
Thank you so much for your contributions. (This and the others)
The idea here for returning the text was that if the embed option does not exist, return the text as-is
For example, the twitter option doesn't exist, so any liquid tag in this form:
{% twitter...
Would return the text.
I would appreciate your suggestions on the workarounds for this.
a return a text value does not change the visited node.
you change nodes only with manipulating the node
or the AST
you can test this by changing it to:
if (embed === undefined) return "not found";
but it not display the not found
in text
see:
refactor index.js
see:
9
refactor index.js
yes, seen. Thank you
https://github.com/dillionmegida/gatsby-remark-liquid-tags/blob/f1c4b5fa4d7217a670298f7a73209bb013354a11/src/index.js#L58
should this be:
because the visitor expect to return
void
or other values, but notstring
:https://github.com/syntax-tree/unist-util-visit/blob/main/types/index.d.ts#L38-L42