from django.utils.html import format_html
from django.contrib.staticfiles.templatetags.staticfiles import static
from wagtail.wagtailcore import hooks


@hooks.register('insert_editor_js')
def draftail_editor_js():
    return format_html('<script src="{0}"></script>',
                       static('wagtaildraftail/wagtaildraftail.bundle.js'))

from django.utils.html import format_html
from django.contrib.staticfiles.templatetags.staticfiles import static
from wagtail.wagtailcore import hooks


@hooks.register('insert_editor_js')
def draftail_editor_js():
    return format_html('<script src="{0}"></script>', static('wagtaildraftail/wagtaildraftail.js'))


@hooks.register('insert_editor_css')
def draftail_editor_css():
    return format_html('<link rel="stylesheet" href="{0}">', static('wagtaildraftail/wagtaildraftail.css'))

Add hook to load CSS
Add hook to load CSS

  from django.utils.html import format_html
  from django.contrib.staticfiles.templatetags.staticfiles import static
  from wagtail.wagtailcore import hooks
  
  
  @hooks.register('insert_editor_js')
  def draftail_editor_js():
+     return format_html('<script src="{0}"></script>', static('wagtaildraftail/wagtaildraftail.js'))
-     return format_html('<script src="{0}"></script>',
-                        static('wagtaildraftail/wagtaildraftail.bundle.js'))
  
+ 
+ @hooks.register('insert_editor_css')
+ def draftail_editor_css():
+     return format_html('<link rel="stylesheet" href="{0}">', static('wagtaildraftail/wagtaildraftail.css'))
+ 
Add hook to load CSS
## Code Before:
from django.utils.html import format_html
from django.contrib.staticfiles.templatetags.staticfiles import static
from wagtail.wagtailcore import hooks


@hooks.register('insert_editor_js')
def draftail_editor_js():
    return format_html('<script src="{0}"></script>',
                       static('wagtaildraftail/wagtaildraftail.bundle.js'))

## Instruction:
Add hook to load CSS
## Code After:
from django.utils.html import format_html
from django.contrib.staticfiles.templatetags.staticfiles import static
from wagtail.wagtailcore import hooks


@hooks.register('insert_editor_js')
def draftail_editor_js():
    return format_html('<script src="{0}"></script>', static('wagtaildraftail/wagtaildraftail.js'))


@hooks.register('insert_editor_css')
def draftail_editor_css():
    return format_html('<link rel="stylesheet" href="{0}">', static('wagtaildraftail/wagtaildraftail.css'))
