Skip to content

Commit

Permalink
perf(rich-text-editor): remove duplicate heading extension
Browse files Browse the repository at this point in the history
remove duplicate heading extension

✅ Closes: COMUI-2981
  • Loading branch information
gavin-everett-genesys committed Jan 7, 2025
1 parent 90349ee commit 32a33a0
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,18 @@ <h2>No action divider</h2>
// - Editor: Main class to create and manipulate the text editor.
// - StarterKit: Provides basic functionality like bold, italic, lists, etc.
// - Underline: Adds underline support to the editor.
// - Heading: Adds heading levels (H1, H2, H3) to the editor.
// - Link : Creates a hyperlink for highlighted text.
const { Editor } = await import('https://cdn.jsdelivr.net/npm/@tiptap/core@2.2.2/+esm');
const StarterKit = (await import('https://cdn.jsdelivr.net/npm/@tiptap/starter-kit@2.2.2/+esm')).default;
const Underline = (await import('https://cdn.jsdelivr.net/npm/@tiptap/extension-underline@2.2.2/+esm')).default;
const Heading = (await import('https://cdn.jsdelivr.net/npm/@tiptap/extension-heading@2.7.4/+esm')).default;
const Link = (await import('https://cdn.jsdelivr.net/npm/@tiptap/extension-link@2.7.4/+esm')).default;
const Highlight = (await import('https://cdn.jsdelivr.net/npm/@tiptap/extension-highlight@2.7.4/+esm')).default;
// Initialize the editor
const editor = new Editor({
element: document.querySelector('.editorElement'),
extensions: [StarterKit, Underline, Highlight, Heading.configure({
levels: [1, 2, 3], // Allows heading levels 1, 2, and 3.
}),Link.configure({
extensions: [StarterKit, Underline, Highlight
,Link.configure({
openOnClick: true, // Automatically opens links when clicked.
autolink: false, // Automatically creates links when typing URLs.
defaultProtocol: 'https', // Default protocol for links if not specified.
Expand Down

0 comments on commit 32a33a0

Please sign in to comment.