# Bug: Embed Code menu item is incorrect for viewof cells

**URL:** <https://talk.observablehq.com/t/bug-embed-code-menu-item-is-incorrect-for-viewof-cells/2472>\
**Category:** Feedback\
**Created:** [October 15, 2019, 8:32pm UTC](https://talk.observablehq.com/t/bug-embed-code-menu-item-is-incorrect-for-viewof-cells/2472 "2019-10-15T20:32:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bgchen](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/bgchen/32/784_2.png) [@bgchen](https://talk.observablehq.com/u/bgchen)\
**Post date:** [October 15, 2019, 8:32pm UTC](https://talk.observablehq.com/t/bug-embed-code-menu-item-is-incorrect-for-viewof-cells/2472/1 "2019-10-15T20:32:27Z")

</div>

Making a separate thread for [this post](https://talk.observablehq.com/t/easier-embedding/2382/7) since it hasn’t yet been addressed:

> [@Easier embedding](https://talk.observablehq.com/t/easier-embedding/2382/7):
>
> Per this thread: [Embedding multiple cells from notebook into a React App](https://talk.observablehq.com/t/embedding-multiple-cells-from-notebook-into-a-react-app/2404/) the code returned by this feature currently isn’t correct for `viewof` cells (I think it should contain `name === "viewof X"` , not `name === "X"` ).

For example, clicking “Embed code” in the menu on [this cell](https://observablehq.com/@observablehq/a-brief-introduction-to-viewof#color) yields:

```html
<div id="observablehq-615a6148"></div>
<script type="module">
import {Runtime, Inspector} from "https://cdn.jsdelivr.net/npm/@observablehq/runtime@4/dist/runtime.js";
import define from "https://api.observablehq.com/@observablehq/a-brief-introduction-to-viewof.js?v=3";
const inspect = Inspector.into("#observablehq-615a6148");
(new Runtime).module(define, name => (name === "color") && inspect());
</script>

```

But I think it should be this, instead:

```html
<div id="observablehq-615a6148"></div>
<script type="module">
import {Runtime, Inspector} from "https://cdn.jsdelivr.net/npm/@observablehq/runtime@4/dist/runtime.js";
import define from "https://api.observablehq.com/@observablehq/a-brief-introduction-to-viewof.js?v=3";
const inspect = Inspector.into("#observablehq-615a6148");
(new Runtime).module(define, name => (name === "viewof color") && inspect());
</script>

```

---

<div class="post-metadata">

**Author:** ![tom](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/tom/32/2262_2.png) [@tom](https://talk.observablehq.com/u/tom)\
**Post date:** [October 15, 2019, 11:12pm UTC](https://talk.observablehq.com/t/bug-embed-code-menu-item-is-incorrect-for-viewof-cells/2472/2 "2019-10-15T23:12:20Z")

</div>

Thanks for the report! We’ve rolled out a fix and embeds now properly specify `viewof` when appropriate.
