Conversation
There was a problem hiding this comment.
I think we should detect tex, and in particular SSR-able tex, by parsing rather string matching or trying to compile and detecting an error. This means using the TemplateParser in tag.js, and then if that succeeds, checking that there are no interpolations.
In the case of inline expressions, it means parsing the expression and likewise checking that it’s a tagged template literal with no interpolations. (And ideally that tex isn’t defined elsewhere in the notebook.) But I think it might even be preferred to not support SSR for inline expressions yet so that we can think about a stronger signal that the user can control to opt-in or opt-out of SSR.
Perhaps we also need to think a bit more generally about how we might SSR JavaScript and HTML and other things too…
|
superseded by #413 |
(still very drafty; I did not regenerate the build tests)
closes #141 for TeX
#153 does a similar thing for DOT.
TODO: