File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -98,13 +98,16 @@ let renderer = {
9898 paragraph_close ( ) { return "" } ,
9999
100100 heading_open ( token ) {
101- if ( token . tag == "h1" ) return `\\label{ ${ chapter [ 1 ] } } ${ / ^ 0 0 / . test ( file ) || chapter [ 1 ] === "hints" ? "\\addchap" : "\\chapter" } {`
101+ if ( token . tag == "h1" ) return `${ / ^ 0 0 / . test ( file ) || chapter [ 1 ] === "hints" ? "\\addchap" : "\\chapter" } {`
102102 if ( token . tag == "h2" ) return `\n\n${ id ( token ) } \\section{`
103103 if ( token . tag == "h3" ) return `\n\n${ id ( token ) } \\subsection{`
104104 if ( token . tag == "h4" ) return `\n\n${ id ( token ) } \\subsubsection{`
105105 throw new Error ( "Can't handle heading tag " + token . tag )
106106 } ,
107- heading_close ( ) { return `}` } ,
107+ heading_close ( token ) {
108+ if ( token . tag == "h1" ) return `}\\label{${ chapter [ 1 ] } }`
109+ return `}`
110+ } ,
108111
109112 bullet_list_open ( ) { return `\n\n\\begin{itemize}` } ,
110113 bullet_list_close ( ) { return `\n\\end{itemize}` } ,
You can’t perform that action at this time.
0 commit comments