Skip to content
Open
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
8 changes: 8 additions & 0 deletions packages/pluggableWidgets/markdown-web/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Changed

- We updated markdown-it dependencies to mitigate potential security vulnerabilities.

### Added

- We added plugin support for subscript and superscript.

## [1.0.3] - 2026-07-17

### Security
Expand Down
6 changes: 4 additions & 2 deletions packages/pluggableWidgets/markdown-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
"dependencies": {
"@mendix/widget-plugin-component-kit": "workspace:*",
"classnames": "^2.5.1",
"markdown-it": "^14.3.0"
"markdown-it": "^15.0.1",
"markdown-it-sub": "^2.0.0",
"markdown-it-sup": "^2.0.0"
},
"devDependencies": {
"@mendix/automation-utils": "workspace:*",
Expand All @@ -58,6 +60,6 @@
"@mendix/widget-plugin-hooks": "workspace:*",
"@mendix/widget-plugin-platform": "workspace:*",
"@mendix/widget-plugin-test-utils": "workspace:*",
"@types/markdown-it": "^14.1.2"
"@types/markdown-it": "^14.2.0"
}
}
6 changes: 5 additions & 1 deletion packages/pluggableWidgets/markdown-web/src/Markdown.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import classNames from "classnames";
import MarkdownIt from "markdown-it";
import sub from "markdown-it-sub";
import sup from "markdown-it-sup";
import { ReactElement, useEffect, useRef } from "react";
import { MarkdownContainerProps } from "../typings/MarkdownProps";
import "./ui/Markdown.scss";
const mdParser = new MarkdownIt("default", {
typographer: true,
linkify: true
});
})
.use(sub)
.use(sup);

export default function Markdown(props: MarkdownContainerProps): ReactElement {
const { stringAttribute } = props;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module "markdown-it-sub" {
import type MarkdownIt from "markdown-it";
const sub: MarkdownIt.PluginSimple;
export default sub;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module "markdown-it-sup" {
import type MarkdownIt from "markdown-it";
const sup: MarkdownIt.PluginSimple;
export default sup;
}
80 changes: 50 additions & 30 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading