Skip to content

Commit

Permalink
ToC: adapt to rich text value
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Dec 15, 2023
1 parent 30037b5 commit 5b0a574
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/block-library/src/table-of-contents/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,9 @@ function getLatestHeadings( select, clientId ) {
latestHeadings.push( {
// Convert line breaks to spaces, and get rid of HTML tags in the headings.
content: stripHTML(
headingAttributes.content.replace(
/(<br *\/?>)+/g,
' '
)
headingAttributes.content
.toString()
.replace( /(<br *\/?>)+/g, ' ' )
),
level: headingAttributes.level,
link: canBeLinked
Expand Down

0 comments on commit 5b0a574

Please sign in to comment.