Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions lib/build-pages/page-builders/md/get-md.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export async function getMd (settingsPath = null) {
const md = markdownIt(mdOpts)
.use(markdownItSub)
.use(markdownItSup)
// @ts-expect-error
.use(markdownItFootnote)
.use(markdownItDeflist)
.use(markdownItEmoji)
Expand All @@ -48,7 +47,6 @@ export async function getMd (settingsPath = null) {
.use(markdownItAbbr)
.use(markdownItTaskList)
.use(markdownItAnchor)
// @ts-expect-error
.use(markdownItAttrs)
.use(markdownItTOC, {
includeLevel: [1, 2, 3],
Expand Down Expand Up @@ -79,7 +77,7 @@ export async function getMd (settingsPath = null) {
* Renders markdown, and accepts an optional markdown-it instance
* @param {string} mdUnparsed unparsed markdown
* @param {object} vars to expose to handlebars
* @param {markdownIt?} [md] an instance of markdown
* @param {InstanceType<typeof markdownIt> | null} [md] an instance of markdown
* @param {string | null | undefined} [settingsPath] Path to the markdown-it settings file
* @return {Promise<string>} Rendered markdown to html
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/build-pages/page-builders/md/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getMd, renderMd } from './get-md.js'
import { extractFirstH1 } from './extract-title-from-md.js'
import { parseMdFileContents } from './parse-md.js'

/** @type {markdownIt | null} */
/** @type {InstanceType<typeof markdownIt> | null} */
let md = null

/**
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
"ignore": "^7.0.0",
"js-yaml": "^5.1.0",
"make-array": "^1.0.5",
"markdown-it": "^14.1.0",
"markdown-it": "^15.0.0",
"markdown-it-abbr": "^2.0.0",
"markdown-it-anchor": "^9.0.1",
"markdown-it-attrs": "^5.0.0",
"markdown-it-deflist": "^4.0.0",
"markdown-it-emoji": "^3.0.0",
"markdown-it-emoji": "^3.1.0",
"markdown-it-footnote": "^4.0.0",
"markdown-it-highlightjs": "^4.1.0",
"markdown-it-ins": "^4.0.0",
Expand All @@ -64,7 +64,6 @@
},
"devDependencies": {
"@playwright/test": "^1.61.1",
"@types/markdown-it": "^14.1.1",
"@types/markdown-it-footnote": "^3.0.4",
"@types/node": "^26.0.1",
"@types/pretty": "^2.0.3",
Expand Down
6 changes: 3 additions & 3 deletions test-cases/general-features/src/markdown-it.settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

/**
* Customize the markdown-it instance
* @param {markdownIt} md - The markdown-it instance
* @returns {Promise<markdownIt>} - The modified markdown-it instance
* @param {InstanceType<typeof markdownIt>} md - The markdown-it instance
* @returns {Promise<InstanceType<typeof markdownIt>>} - The modified markdown-it instance
*/
export default async function markdownItSettingsOverride (md) {
// Add custom container for test-box
Expand All @@ -25,7 +25,7 @@ export default async function markdownItSettingsOverride (md) {
function createTestBoxPlugin () {
const TEST_BOX_MARKER = 'test-box'

return (/** @type {markdownIt} */md) => {
return (/** @type {InstanceType<typeof markdownIt>} */md) => {
// @ts-ignore
const container = (state, startLine, endLine, silent) => {
let pos = state.bMarks[startLine] + state.tShift[startLine]
Expand Down