If a cell contains comments before the first statement or after the last, then these comments are not included in the exported module. This poses a problem, as it means that inlined attribution might get dropped. This behavior is not intuitive and may cause authors to involuntarily violate licenses of copied code.
Expected behavior
Given a cell:
// Comment before
foo = "bar"
// Comment after
the compiled code should read:
main.variable(observer("foo")).define("foo", function(){return(
// Comment before
"bar"
// Comment after
)});
It also becomes impossible to properly use JSDoc style inline documentation, as leading docblocks are dropped. In order to access them, one would have to fetch the raw cell contents from Observable's internal API.
Describe the bug
If a cell contains comments before the first statement or after the last, then these comments are not included in the exported module. This poses a problem, as it means that inlined attribution might get dropped. This behavior is not intuitive and may cause authors to involuntarily violate licenses of copied code.
Expected behavior
Given a cell:
the compiled code should read: