Public
Edited
Nov 9, 2023
Fork of Using tiptap
1 fork
Insert cell
Insert cell
editor.getJSON()
Insert cell
editor.getHTML()
Insert cell
viewof editor = {
const root = html`<div />`
const editor = new tiptap.Editor({
element: root,
editable: false,
extensions: [tiptap.StarterKit, tiptap.Highlight, tiptap.TextStyle, tiptap.Link],
content: `<span style=".superClass">The cool kids can apply monospace fonts aswell.</span>`
})

root.value = editor
return root
}
Insert cell
logToConsole = function(){
console.log("from logtoconsole")
}
Insert cell
editor.chain()
.setLink({ href: "javascript:logToConsole()", rel: "noopener noreferrer", class: "myLink" })
.insertContent("SOME")
.run()
Insert cell
{
var links = document.querySelectorAll('.myLink');
for (var i = 0; i < links.length; i++) {
links[i].addEventListener('click', function(event) {
event.preventDefault(); // Prevent the default behavior of the link
logToConsole();
});
}
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
tiptapStyle = import(`//cdn.skypack.dev/@tiptap/extension-text-style@${tiptapVersion}?min`).then(module => module.default)
Insert cell
Insert cell
Insert cell
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