1- module . exports = heading
1+ import repeat from 'repeat-string'
2+ import { formatHeadingAsSetext } from '../util/format-heading-as-setext.js'
3+ import { containerPhrasing } from '../util/container-phrasing.js'
24
3- var repeat = require ( 'repeat-string' )
4- var formatHeadingAsSetext = require ( '../util/format-heading-as-setext.js' )
5- var phrasing = require ( '../util/container-phrasing.js' )
6-
7- function heading ( node , _ , context ) {
5+ export function heading ( node , _ , context ) {
86 var rank = Math . max ( Math . min ( 6 , node . depth || 1 ) , 1 )
97 var exit
108 var subexit
@@ -14,7 +12,7 @@ function heading(node, _, context) {
1412 if ( formatHeadingAsSetext ( node , context ) ) {
1513 exit = context . enter ( 'headingSetext' )
1614 subexit = context . enter ( 'phrasing' )
17- value = phrasing ( node , context , { before : '\n' , after : '\n' } )
15+ value = containerPhrasing ( node , context , { before : '\n' , after : '\n' } )
1816 subexit ( )
1917 exit ( )
2018
@@ -35,7 +33,7 @@ function heading(node, _, context) {
3533 sequence = repeat ( '#' , rank )
3634 exit = context . enter ( 'headingAtx' )
3735 subexit = context . enter ( 'phrasing' )
38- value = phrasing ( node , context , { before : '# ' , after : '\n' } )
36+ value = containerPhrasing ( node , context , { before : '# ' , after : '\n' } )
3937 value = value ? sequence + ' ' + value : sequence
4038 if ( context . options . closeAtx ) {
4139 value += ' ' + sequence
0 commit comments