import { test, expect } from 'vitest' import { deeplyParseHeader } from 'node/utils/parseHeader' test('deeplyParseHeader', () => { const asserts: Record = { // Remove tail html '# `H1` ': '# H1', '# *H1* ': '# H1', // Reserve code-wrapped tail html '# `H1` ``': '# H1 ', '# *H1* ``': '# H1 ', // Remove leading html '# `H1`': '# H1', '# *H1*': '# H1', // Reserve code-wrapped leading html '# `` `H1`': '# H1', '# `` *H1*': '# H1', // Remove middle html '# `H1` `H2`': '# H1 H2', '# `H1` `H2`': '# H1 H2', // Reserve middle html '# `H1` `` `H2`': '# H1 H2', '# `H1` `` `H2`': '# H1 H2' } Object.keys(asserts).forEach((input) => { expect(deeplyParseHeader(input)).toBe(asserts[input]) }) })