Published
Edited
Apr 11, 2022
Insert cell
Insert cell
mdh`Sample
~~~
___yellow___
aaa ~~~pink~~~ bbb
===transparent===
~~~
`
Insert cell
// markdown with yellow and pink highlights
mdh = {
const hljs = window.hljs || (await require("@observablehq/highlight.js"));

return function () {
const node = md(...arguments);
for (const fragment of node.querySelectorAll("code")) {
hljs.highlightBlock(fragment);

fragment.innerHTML = fragment.innerHTML.replace(
/___(.*?)___/g,
"<mark>$1</mark>"
);
fragment.innerHTML = fragment.innerHTML.replace(
/~~~(.*?)~~~/g,
'<mark style="background:pink">$1</mark>'
);
fragment.innerHTML = fragment.innerHTML.replace(
/===(.*?)===/g,
'<mark style="color:transparent;background:transparent">$1</mark>'
);
}

return node;
};
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more