►
From YouTube: FE Pairing - 20210813 - Add ToC Content Editor Extension
Description
In this session we pair up on adding a "Table of Contents" extension to GitLab's new WYSIWYG Content Editor.
Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/338270
MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68210
A
A
And
lee,
are
you
familiar
with
what
the
content
editor
is
not
yet,
but
hopefully.
C
D
Adding
support
for
new
content
types
in
the
content
later,
so
they
they,
the
contaminator.
Is
we
secretor
for
get
that
flavor
markdown?
E
E
Only
what
you
define
can
be
added
like
if
you
say
that
a
bullet
list
can
only
have
list
items,
so
that's
the
rule
and
no
one
can
break
that,
but
in
action
html
you
can
have
tables
inside
lists
inside
tables
and
whatnot,
so
that
makes
it
very
prone
to
bugs
so
by
having
something
that
is
restricted
by
a
schema.
That
is
very
useful
for
us.
Also
like
you
cannot.
E
D
Exactly
and
the
the
library
that
that
we
are
using,
as
you
might
you
said,
is
pros
meter
and
they
provide
support
for
mark
them
for
certain
elements
in
in
gitlab,
flavor
markdown,
like
git
flow
heat,
lock,
flavor
markdown,
is
a
super
set
of
common
mark.
That
is,
you
know,
like
the
the
specification
for
markdown
and
mark,
has
specifications
for
headings
and.
F
D
But
it
doesn't
have
any
specification
for
tables,
so
we
need
to
implement
to
extend
cross
meter
to
know
how
to
generate
markdown
for
tables
and-
and
there
are
other
elements
like
gitlab
flavor
markdown-
support,
audio
video
support,
collapsible
content,
support
definition
list.
All
of
that.
None
of
that
is
a
standard,
higher
standard
fixtures
of
markdown.
So
now
we
have
to
write
serializers,
that's
how
we
call
it
call
them
to
generate
markdowns
for
those
content,
types
from
the
content,
editor.
A
Yep,
it
is-
and
I
really
really
like
so
tip
tap-
is
this
wrapper
around
pros
mirror
which
ex
extends
uses
it
as
its
core
but
extends
it
quite
a
bit,
and
I
really
like
tip
taps
their
api
for
creating
these
extensions
and
so
some
of
the
extensions
we
have
in
the
code
already.
E
Actually,
those
their
distinctions
live
in
two
places,
so
there
was
some
work
done
with
tiptap
around
two
years
ago
for
generating.
E
Like
paste
has
marked
on
feature
so
there
are
some
extensions
here,
but
there
are
also
some
extensions
in
the
behaviors.
So
for
the
most
part
we
just
need
to
copy
some
of
the
stuff
from
this
tabs
on
stuff
from
behaviors,
and
our
work
should
mostly
be
complete
cool.
E
A
Yeah,
I've
just
found
an
extension
that
looks
slightly
non-trivial
and
I
see
it's
like
extending
a
base
extension
so
because
we
had
like
some
specific
behavior
that
we
here,
I
guess
so.
It's
correct
me
if
I'm
wrong,
but
this
epic
is
just
a
matter
of
making
sure
that
we
can
support
all
of
the
gfm
content
by
adding
extensions
for
these
certain
types
of
nodes
marks,
whatever
they're
called
okay
cool,
and
so
we've
got
a
couple
of
them
already.
E
I
think
I
was
thinking
of
picking
up
audio.
F
E
A
A
D
A
Yeah,
so
what
do
you
think
of
you
want
to
try
this
one
out?
I'm
I'm
down
for.
A
E
Obviously
sounds
a
good
one,
there's
already
an
implementation
of
different
behaviors.
So
if
you
want,
you
can
look
at
that.
D
Is
at
some
point
we're
gonna
have
out
of
those
extensions
implemented
in
the
content
later
and
we
can
delete
behavior.
We
don't
need
to
implement
them.
You
know
to
have
two
implementations.
A
Let
me
just
first,
let
me
see
if
I
can
get
the
gdk
running,
so
we
can
maybe
see
whatever
is
going
to
happen,
but
the
new
extension
we
won't
be
able
to
use
this
old.
We
won't
be
able
to
use
this
or
like
right.
E
We
can
use
this,
we
just
have
to
repurpose
it
with
your
syntax.
A
D
Okay,
cool:
I
can
also
start
by
by
adding
a
failing
test.
D
Yes,
so
now
you
can
add
an
item
to
the
gmo
file
where
you
know,
you're
gonna
write
like
a
piece
of
markdown
snippet
that
is
a
table
of
contents.
You're.
D
E
Yep
got
it
yeah,
but
but
you
also
need
to
have
some
headings
in
there.
Yeah
yeah.
D
D
Just
use
a
simple
string:
do.
D
B
A
C
B
Now
we'll
see
what
happens,
I
mean
interesting
all
the
patches
that
they're
making
to
get
and
yeah
to
stop
when
we're,
pushing
and
raising
mrs
at
the
moment,
there's
some
yeah,
some
real
real
performance
issues
that
preventing
community
folks
from
raising
their
miles
from
forks
and
stuff,
but
apparently
there's
some
bonkers
behavior
that
goes
on
when
you,
when
you
push
and
that
basically
like
walks
like
two
million
refs
and
stuff,
like
that,
that's
just
yeah.
I
don't
know
how
people
work
on
bigger
projects
than
git
lab.
A
Yeah
yeah,
that's
it's!
It's
really
unfortunate.
The
situation
that
community
members
are
are
facing
or
community
contributors
that
are
contributing
off
of
forks.
I
I'm
really
impressed,
though,
with
some
of
the
solutions
and
how
quickly
we're
hopefully
able
to.
B
F
B
A
Yeah,
I
don't
I
don't
know,
I
don't
know
it's
it's
a
lot
of
work,
though.
A
A
E
A
F
A
F
A
E
A
Yeah,
I
I
thought
I
wasn't
sure
either
that's
why
it
was.
I
tried
that
out
because
I
was
like,
oh,
I
don't
know,
what's
going
to
happen
with
this
edge
case,
but
this
is
the
syntax
right,
yeah,
that's
right,
and
what
what
we
would.
Let
me
save
this,
but
what
we
need
to
have
happen
is
if
I
switch
to
using
the
new
editor,
somehow
we
are
either
presenting
it
or
something
so,
but
right
now
just
kind
of
doing
something.
D
A
So
all
right
all
right,
so
we
kind
of
got.
We
got
somewhat
of
a
feedback
loop
and
I've
got
a
file.
I
really
don't
know
what
to
do
here.
I
see
some
examples
but
they're
all
extending
existing
extensions.
Is
there
one
where
we're
creating
a
new
extension.
F
Yeah
we
can
start
with
emoji.
Okay
emoji
creates
a
new
node.
E
E
Just
copy
it
over
and
yes,
let's
do
that.
A
F
This
this
says:
oh
gee,
you
you
don't
need
any
input.
So,
okay,.
F
A
E
You
you
can,
you
can
make
it
hundred
that's
what
we
use
right
now,
but
then
we
can
recap
it
later
to
make
the
constant
again.
A
Yeah:
okay,
cool:
oh,
look
render
html.
A
I'm
just
deleting
things:
oh,
we
need.
E
A
Okay,
okay,
cool.
I
have
no.
E
A
A
Okay,
let's
do
it
so
I
got
rid
of
it.
I'm
gonna
go
back
to
here
and.
A
E
A
A
A
A
Okay,
why
is
this
so
all
right,
yeah?
Normally
it
doesn't
highlight
like
that,
but
I'm
so
done
with
searching
right
now.
Okay,
it's
table
of
contents
starts
with
table
lml
pqr.
A
A
A
E
That
can
you
add
it
below
paragraph,
because
I
don't
want
conflict
with
the
tables.
Mr,
yes,.
D
G
A
Okay
cool,
so
we're
saying
this
should
all
work
now.
A
But
yeah,
that's
fine!
It's
what
you'd
expect,
because
I
don't
know
like
how's
it.
I
don't
know
I'd
kind
of
expect
it
like
that.
It's
a
little
weird,
though
this
might
fall
in
the
bucket
of
user
error.
A
F
F
Just
to
try
to
delete
something
like
can
you
just
delete
it?
Do
you
want
me
to
delete
the
table
of
contents.
E
Yeah
yeah,
when
you
press
backspace,
if
you
delete
the
entire
thing
it's
gone,
yeah
you
can
undo
to
bring
it
back.
Yep,
yeah
yeah.
It
works
for
the
most
part
that
it's
a
single
entity.
Now
all
you
need
to
do
is
instead
of
having
this
phrase
or
table
of
contents,
you
need
to
have
the
actual
elements
instead
of
the
table
of
contents
itself,.
A
Yeah
yeah
and
we
I
think
we
could
do
that
that'd
be
cool.
Maybe,
and
we
get
some
more
time
we
can.
We
can
try
that
out.
So
this
is
what
we
were
expecting.
D
Yeah
yeah
that
sounds
like
it.
It
went
pretty
well,
I
think
that
if
we
do,
you
know
like
if
we
start
like
displaying
the
the
actual
list
we
are
going
to
go
above
and
beyond.
Let's.
B
Do
all
the
other
options,
whatever
you
want
to
call
them
excellent.
E
Yeah
we
need
we
should,
but
we
need
to
think
more
about
how
to
put
all
the
toolbar
buttons
into
a
single
more
more
button
like
a
like
a.
E
A
E
Let's,
let's
create
a
an
input
rule.
A
A
So
I
got
rid
of
our
import
well,
we
still
need
that.
Let
me
see
where
we're
gonna
put
rule
again.
This
is
this:
is
it
so
you
can.
D
Do
it
way
easier
than
that
go
to
the
to
that?
The
second?
The
second
search
result
this
one
that
one
yeah
that's
like
a
helper,
where
you
can
just
like
put
the
regular
expression
on
the
and
pass
the
the
node
type
and
that's
it
like.
I
implemented
in
emoji
a
more
complex,
regular
expression,
because
I
needed
to
do
you
know
some
things,
but
all
those.
A
A
A
Oh
yeah,
I
don't
need
this,
I'm
just
going
to
call
this
input.
Rule
regex
x
and
we're
talking
about
bracket
bracket,
underscore
tlc
bracket
bracket.
D
There
is
also
an
alias
for
it,
like
you
can
do
it
in
in
two
ways
like
only
using
one
bracket
and
tlc
or
that
syntax.
That
is
a
little
bit
more
complicated.
So
we
could
even
allow
the
user
to
use
both
yeah.
A
E
A
A
Yeah
pipes
get
weird
yeah,
it
put
it
in.
F
A
Oh,
it
sure
did
just
put
a
pipe
there
might
as
well
just
put
a
pipe
there.
That's
pretty
funny
yeah!
We
could.
I
guess,
do
you
do
you
want?
Do
you
all
think
this
is
kind
of
cool
of
like
just
mapping,
you
know
two
rules.
D
That's
okay,
okay,
but
that's
like
it
would
have
like
only
two
items.
I
would
have
done
like
repeated
expression,
but
that's
true,
but
I
don't
know
we
have
all
we
all
have
preferences
so.
A
This
is,
this
is
very
true,
so,
yes
feel
free
to
interject
with.
If,
if
you
have
a
strong
preference
of
doing
something
different,
please
let
me
know
and
we'll
do
it
I'm
just
playing
around
so
now
I
should
be
able
to
add
one,
I'm
gonna
refresh
this,
and
now
I
should
be
able
to
from
the
markdown
editor
or
from
the
new
editor
delete
this
and
then
re-add
it
we're
talking.
A
Yes,
let's
do
that
one
thing
that
is
hard
here.
This
would
be
nice
if
I
could
see
my
cursor
like
if
I
could
see
it
go
from
before
the
table
of
contents
and
then
all
the
way
get
to
the
end
of
it,
but
like
right
now
I
don't
really
quite
know
where
I
am,
but
now
that
we're
talking
about
it.
I
see
this
weird
thing
highlighting
I
kind
of
would
expect
to
see
it
right
after
s,
but
that's
just
me
being
picky,
but
yeah.
Let's
try
the
other
way.
E
A
I
kind
of
would
like
to
see
I'm
kind
of
curious
to
know
if,
like
keeping
it
live
like
if
that
would
need
to
change
our
approach
a
bit.
I'd
almost
want
to
see
what
do
you
think
of
doing
this
for
our
next
feedback
loop?
But
what?
If
oh
gosh,
okay,
wait?
Wait?
We
really
need
to
put
this
what'd.
You
say.
D
A
A
What
do
you
think
of
tape
showing
just
table
of
contents,
but
then
with
like
a
bracket
of
how
many
headers
they
are
like?
Let's
maybe
not
worry,
about
rendering
it,
but
just
make
sure
we
can
stay
up
to
date
and
then
once
we're
like
okay,
now,
we've
got
something
happening.
That's
updating!
Now,
let's
just
write
the
pure
render
function
of
how
it
should
actually
render.
What
do
you
think
of
solving
the
updating
I'd
like
to
try
to
solve
the
updating
problem
first
and
then
we'll
render
it.
A
Okay
but
what'd,
you
say.
A
Yeah,
I
don't
know
I
do
we
want
to
take
a
look
at
this
tutorial.
You
were
talking
about
in
regard.
D
Yeah,
let
me
let
me
see
the
link
where,
where
should
I
send
it?
You
can.
A
Yup
awesome,
okay,
so
we're
talking
about
that's
dragging
here's
the
table
of
contents.
Okay,
all
right!
Let's,
let's
see
what
are
we
doing
here?
Is
this
really
working?
Oh,
it
does
work.
Okay,
all
right.
A
A
D
Changes,
that's
it
the
handle,
update
method.
It
will
iterate
well
through
the
documentary
pick
up
the
hidden,
the
hidden
notes.
D
A
E
E
In
there's,
a
folder
under.
D
A
Cool
cool,
okay,
great,
so
I'm
gonna
just
do
something
crazy
right
now,
we're
just
gonna
have
to
say
table
of
contents
from
view.
B
Side
note,
while
paul's
bashing
away,
why
don't
we
use
the
content
editor
in
like
comments
and
issue
descriptions
and
whatnot
yeah?
That's
the
goal:
okay!
Okay,
that's
the
plan
cool,
so
is
the
wiki
kind
of
the.
I
don't
know:
guinea
pig
yeah.
That's
right!
Awesome,
yeah,
because.
A
Okay,
we
got
to
really
somehow
put
this
over
here.
My
first
reaction
when
I
see
this
is
to
x
out
of
it,
gitlab
has
trained
me
to
ignore.
A
No
okay
yeah,
I
thought
something's,
not
working.
Is
it
because
I'm
doing
render
html?
I
need
to
get
rid
of
this.
A
So
so
that's
interesting:
we
give
it
a
try,
yeah
and
that's
an
it's.
It's
interesting
that
they
have
those
as
a
separate
functions.
I
would
imagine
that
there's
some
sort
of
abstraction
there.
That's
like
that's
some
comment.
D
A
G
G
A
All
right
I
realize
now
I
also
spelled
this.
That
is
about
all
we
need
from
it.
I
imagine
yep,
okay,
okay,
do
I
need
to
give
it
a
name?
Maybe
do
we
usually
do
I
try,
I
usually
don't
give
components
names,
but
is
do
you
think
it
requires
it
to
have
a
name.
A
A
And
it
sounds
like
if,
if,
if
we
get
an
unexpected
error,
maybe
we
might
be
swallowing
them.
Is
there
a
way
that
we
can
make
sure
that
we
can
have
it
in
the
console.
E
G
E
I
guess
you
need
that
function.
You
can
just.
E
F
But
we
don't
want
it.
E
Right,
we
do
want
it,
because
you
will
mention
you
prevented
something.
You
need
to
return
something,
even
if
you,
even
if
you
don't
want
it,
you
should
return
something
like
an
empty
object
or
something.
B
E
You
can
just
use
whatever
is
that
in
the
in
the
tutorial.
A
Tutorial
that
you
had
up
in
oh
yes,
good
idea,
so
they
add
node
view
oh
yeah
and
they're,
rendering
they
shim
up.
Well,
why
didn't
it
work
yeah?
I
think
you
can.
E
A
A
E
So
yeah
you
can
just
delete
the
table
of
contents
string
there.
You
don't
really
need
that.
A
I
got
cool,
I
know
it's.
I
know
it's
that
time.
So
I'll
I'll
create
an
mr
for
this
and
push
it
up,
and
I
may
I
may
try
to
go
down
a
little
bit
of
that
tutorial
of
making
the
component
react
to
changes
and
stuff.
So
we
can
update
the
table.
Content
sounds
so
sweet
wow,
I'm
so
impressed
that
we
can
use
view
components
like
this.
That's
going
to
be
amazing,
really
cool.