🏠 back to Observable

Convert existing md`...` cells to markdown

It would be awesome to have a button/autofix to convert tagged cells to their native equivalents. Here’s some code to help with that in the meantime:

md = (strings, ...interps) =>
  html`<pre>${DOM.text(
    strings
      .flatMap((s, i) =>
        i == strings.length - 1 ? [s] : [s, `\${INTERPOLATION ${i}}`]
      )
      .join("")
  )}
3 Likes