Skip to content

Commit 4e6329e

Browse files
committed
chore: update tests to match new heading output
1 parent 321fe3a commit 4e6329e

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

src/format/headings.test.ts

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
linkify_headings,
1616
strip_h1,
1717
increment_headings,
18-
validate_headings,
1918
} from "./headings";
2019

2120
const { process: linkify_only } = unified()
@@ -53,7 +52,7 @@ _headings("transforms and formats headings", async () => {
5352

5453
assert.equal(
5554
output.contents,
56-
`<h3><span id="section-hello" class="offset-anchor"></span><a href="blog#section-hello" class="anchor" aria-hidden></a>hello</h3>`
55+
`<h3 id="section-hello">hello</h3>`
5756
);
5857
});
5958

@@ -81,8 +80,8 @@ _headings("transforms and formats multi-level headings", async () => {
8180

8281
assert.equal(
8382
output.contents,
84-
`<h3><span id="subsection" class="offset-anchor"></span><a href="blog#subsection" class="anchor" aria-hidden></a>subsection</h3>
85-
<h4><span id="subsection-subsubsection" class="offset-anchor"></span><a href="blog#subsection-subsubsection" class="anchor" aria-hidden></a>subsubsection</h4>`
83+
`<h3 id="subsection">subsection</h3>
84+
<h4 id="subsection-subsubsection">subsubsection</h4>`
8685
);
8786
});
8887

@@ -113,9 +112,9 @@ _headings("transforms and formats multi-level headings", async () => {
113112

114113
assert.equal(
115114
output.contents,
116-
`<h3><span id="subsection" class="offset-anchor"></span><a href="blog#subsection" class="anchor" aria-hidden></a>subsection</h3>
117-
<h4><span id="subsection-subsubsection" class="offset-anchor"></span><a href="blog#subsection-subsubsection" class="anchor" aria-hidden></a>subsubsection</h4>
118-
<h5><span id="subsection-subsubsection-subsubsubsection" class="offset-anchor" data-scrollignore></span><a href="blog#subsection-subsubsection-subsubsubsection" class="anchor" aria-hidden></a>subsubsubsection</h5>`
115+
`<h3 id="subsection">subsection</h3>
116+
<h4 id="subsection-subsubsection">subsubsection</h4>
117+
<h5 id="subsection-subsubsection-subsubsubsection">subsubsubsection</h5>`
119118
);
120119
});
121120

@@ -154,13 +153,13 @@ _headings("transforms and formats multi-level headings", async () => {
154153

155154
assert.equal(
156155
output.contents,
157-
`<h3><span id="subsection" class="offset-anchor"></span><a href="blog#subsection" class="anchor" aria-hidden></a>subsection</h3>
158-
<h4><span id="subsection-subsubsection" class="offset-anchor"></span><a href="blog#subsection-subsubsection" class="anchor" aria-hidden></a>subsubsection</h4>
159-
<h5><span id="subsection-subsubsection-subsubsubsection" class="offset-anchor" data-scrollignore></span><a href="blog#subsection-subsubsection-subsubsubsection" class="anchor" aria-hidden></a>subsubsubsection</h5>
160-
<h3><span id="one" class="offset-anchor"></span><a href="blog#one" class="anchor" aria-hidden></a>one</h3>
161-
<h4><span id="one-two" class="offset-anchor"></span><a href="blog#one-two" class="anchor" aria-hidden></a>two</h4>
162-
<h5><span id="one-two-three" class="offset-anchor" data-scrollignore></span><a href="blog#one-two-three" class="anchor" aria-hidden></a>three</h5>
163-
<h4><span id="one-four" class="offset-anchor"></span><a href="blog#one-four" class="anchor" aria-hidden></a>four</h4>`
156+
`<h3 id="subsection">subsection</h3>
157+
<h4 id="subsection-subsubsection">subsubsection</h4>
158+
<h5 id="subsection-subsubsection-subsubsubsection">subsubsubsection</h5>
159+
<h3 id="one">one</h3>
160+
<h4 id="one-two">two</h4>
161+
<h5 id="one-two-three">three</h5>
162+
<h4 id="one-four">four</h4>`
164163
);
165164
});
166165

@@ -201,13 +200,13 @@ _headings(
201200

202201
assert.equal(
203202
output.contents,
204-
`<h2><span id="subsection" class="offset-anchor"></span><a href="blog#subsection" class="anchor" aria-hidden></a>subsection</h2>
205-
<h3><span id="subsection-subsubsection" class="offset-anchor"></span><a href="blog#subsection-subsubsection" class="anchor" aria-hidden></a>subsubsection</h3>
206-
<h4><span id="subsection-subsubsection-subsubsubsection" class="offset-anchor" data-scrollignore></span><a href="blog#subsection-subsubsection-subsubsubsection" class="anchor" aria-hidden></a>subsubsubsection</h4>
207-
<h2><span id="one" class="offset-anchor"></span><a href="blog#one" class="anchor" aria-hidden></a>one</h2>
208-
<h3><span id="one-two" class="offset-anchor"></span><a href="blog#one-two" class="anchor" aria-hidden></a>two</h3>
209-
<h4><span id="one-two-three" class="offset-anchor" data-scrollignore></span><a href="blog#one-two-three" class="anchor" aria-hidden></a>three</h4>
210-
<h3><span id="one-four" class="offset-anchor"></span><a href="blog#one-four" class="anchor" aria-hidden></a>four</h3>`
203+
`<h2 id="subsection">subsection</h2>
204+
<h3 id="subsection-subsubsection">subsubsection</h3>
205+
<h4 id="subsection-subsubsection-subsubsubsection">subsubsubsection</h4>
206+
<h2 id="one">one</h2>
207+
<h3 id="one-two">two</h3>
208+
<h4 id="one-two-three">three</h4>
209+
<h3 id="one-four">four</h3>`
211210
);
212211
}
213212
);
@@ -242,10 +241,10 @@ _headings(
242241

243242
assert.equal(
244243
output.contents,
245-
`<h3><span id="component-format-script" class="offset-anchor"></span><a href="docs#component-format-script" class="anchor" aria-hidden></a>script</h3>
246-
<h4><span id="component-format-script-one" class="offset-anchor"></span><a href="docs#component-format-script-one" class="anchor" aria-hidden></a>one</h4>
247-
<h5><span id="component-format-script-one-two" class="offset-anchor" data-scrollignore></span><a href="docs#component-format-script-one-two" class="anchor" aria-hidden></a>two</h5>
248-
<h3><span id="component-format-style" class="offset-anchor"></span><a href="docs#component-format-style" class="anchor" aria-hidden></a>style</h3>`
244+
`<h3 id="component-format-script">script</h3>
245+
<h4 id="component-format-script-one">one</h4>
246+
<h5 id="component-format-script-one-two">two</h5>
247+
<h3 id="component-format-style">style</h3>`
249248
);
250249

251250
//@ts-ignore

0 commit comments

Comments
 (0)