# ¯\\\_(ツ)\_/¯

**URL:** https://talk.observablehq.com/t/topic/1722
**Category:** Uncategorized
**Created:** [March 4, 2019, 11:08pm UTC](https://talk.observablehq.com/t/topic/1722 "2019-03-04T23:08:39Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Fil](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/fil/32/207_2.png) [@Fil](https://talk.observablehq.com/u/Fil)
#### Post date: [March 4, 2019, 11:08pm UTC](https://talk.observablehq.com/t/topic/1722/1 "2019-03-04T23:08:39Z")

</div>

Backslashes incoherence in md?  
See [https://observablehq.com/d/0fda090b1854d115](https://observablehq.com/d/0fda090b1854d115) for the issue.

---

<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: [March 4, 2019, 11:35pm UTC](https://talk.observablehq.com/t/topic/1722/2 "2019-03-04T23:35:17Z")

</div>

It’s certainly unwieldy, but there is a reason for it.

In markdown, [both backslashes and underscores have to be escaped by backslashes](https://daringfireball.net/projects/markdown/syntax#backslash). ([`md`](https://github.com/observablehq/stdlib/blob/master/README.md#md) relies on [marked](https://github.com/markedjs/marked) for its implementation, and marked follows this part of the markdown spec). So to get `\_` in markdown, you have to type `\\\_`.

In your notebook, `md` is applied to a JS template literal, where backslashes have to be escaped with backslashes – the result is that instead of 3 required backslashes, 6 are required.

---

<div class="post-metadata">

### Author: ![Fil](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/fil/32/207_2.png) [@Fil](https://talk.observablehq.com/u/Fil)
#### Post date: [March 4, 2019, 11:58pm UTC](https://talk.observablehq.com/t/topic/1722/3 "2019-03-04T23:58:37Z")

</div>

Well explained for the md part. But most of the headers are probably over-escaped:

- `<title>` shows 6 \\\\\\ in the browser window title.
- `<og:title>` shows a lot of them too (too many according to [opengraphcheck](https://opengraphcheck.com/result.php?url=https%3A%2F%2Fobservablehq.com%2Fd%2F0fda090b1854d115))
- `<meta name="description"` has only one (as plain text) 👍
- `<script type="application/ld+json">` has too many (according to [google debug](https://search.google.com/structured-data/testing-tool/u/0/#url=https%3A%2F%2Fobservablehq.com%2Fd%2F0fda090b1854d115)).

---

<div class="post-metadata">

### Author: ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)
#### Post date: [March 5, 2019, 12:15am UTC](https://talk.observablehq.com/t/topic/1722/4 "2019-03-05T00:15:39Z")

</div>

We currently pull the title from the _source_, not from the runtime value, hence the additional backslashes. That’s also why if you have a notebook like

```auto
md`Hello, ${subject}!`

```

```auto
subject = "World"

```

the extracted title is

```auto
Hello, ${subject}!

```

not

```auto
Hello, World!

```

We’ve considered using the runtime (computed) value instead for the title, but this would require defining when the value should be captured (since if we use the runtime value, the title can change dynamically even if the source code hasn’t changed, and we must wait for the value to resolve).

We’re alternatively considering allowing you to specify the title explicitly as metadata, rather than only extracting it from the source (or runtime) values.

---

<div class="post-metadata">

### Author: ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)
#### Post date: [March 6, 2019, 4:26am UTC](https://talk.observablehq.com/t/topic/1722/5 "2019-03-06T04:26:42Z")

</div>

Good news! We just shipped runtime title evaluation. So, what you see should always be what you get (in the title, notebook listings, and the notebook’s published URL)—even if your title has embedded expressions.

The extra nice thing about this feature is that the title extraction is more robust. It’ll work if you have a kicker:

```auto
md`### This is a kicker.
# And this is the title.`

```

And it’ll work if you use an HTML tagged template literal, or anything else that generates an H1 element.

```auto
html`<h1>¯\\_(ツ)_/¯</h1>`

```

Or even:

```auto
html`<h1>${String.raw`¯\_(ツ)_/¯`}`

```

Or:

```auto
md`# ${DOM.text(String.raw`¯\_(ツ)_/¯`)}`

```
