---
title: "Marked: CommonMark HTML block fix in TypeScript | VulCode"
description: "A fix to the Marked Markdown parser in TypeScript: an HTML block with a tab after the tag name or at the end of input stays raw, as CommonMark requires."
url: "https://vulcode.com/en/opensource/contributions/marked"
lang: "en"
---

[All contributions](https://vulcode.com/en/opensource/contributions)

markedjs/marked

# Marked

A fast Markdown parser and compiler to HTML, written in TypeScript and following CommonMark and GitHub Flavored Markdown.

[See the repository](https://github.com/markedjs/marked) [All contributions](https://vulcode.com/en/opensource/contributions)

- **Language**: TypeScript
- **GitHub stars**: 37,323
- **Merged changes**: 1
- **Project site**: [marked.js.org](https://marked.js.org)

## What we changed

The CommonMark type 6 HTML block now accepts a tab after the tag name and a tag at the very end of the input, so such HTML passes through unchanged, as in commonmark.js.

### What this work shows

- The CommonMark 0.31.2 spec

- Regular expressions in parsers

- Differential testing against a reference

What was broken

### A tab after the tag name broke the HTML block

The type 6 HTML block rule only accepted spaces, a newline, > or /> after the tag name, while CommonMark 0.31.2 also allows a tab and the end of the line. With a tab after <div the paragraph swallowed the opening tag, and a list item written as "- <div" at the very end of the input became &lt;div.

How we fixed it

### Tab and end of input in the block rule

We extended the html rule's regular expression with a tab and the end of input. On 67,704 generated documents compared with commonmark.js, 23,063 outputs went from wrong to right and none from right to wrong. Two tests that failed before the change were added.

[#4128](https://github.com/markedjs/marked/pull/4128)

## Merged change

1 26 October 2026

- [01 #4128Merged 26 October 2026 fix: allow a tab or end of input after a type 6 html block tag name](https://github.com/markedjs/marked/pull/4128)

## What it taught us

We check a change to a parser's regular expression on a large set of generated documents, against a reference implementation. Such a test shows not only what the change fixed but also that it broke nothing.

[More about this technology: TypeScript, React and Node](https://vulcode.com/en/technologies/typescript-react-and-node)

## Other projects we write code for

- [**Material UI** JavaScript · 99,391 stars A React component library that implements Google's Material Design: ready-made text fields, selects, buttons and other interface elements.](https://vulcode.com/en/opensource/contributions/material-ui)

- [**Grafana** TypeScript · 78,050 stars An open observability and data visualisation platform that shows metrics, logs and traces from Prometheus, Loki, Elasticsearch, PostgreSQL and many other sources on dashboards.](https://vulcode.com/en/opensource/contributions/grafana)

- [**Autoprefixer** JavaScript · 22,197 stars A PostCSS plugin that adds browser prefixes to CSS based on Can I Use data, including the -ms-grid syntax for CSS Grid layouts.](https://vulcode.com/en/opensource/contributions/autoprefixer)

- [**Lichess** TypeScript · 19,013 stars The lichess.org chess server: free, ad-free and open source, focused on real-time play. The back end is written in Scala, the interface in TypeScript.](https://vulcode.com/en/opensource/contributions/lichess)

- [**compromise** JavaScript · 12,176 stars A natural language processing library in JavaScript: it splits text into sentences and words, tags parts of speech, conjugates verbs and inflects nouns, and reads dates through a plugin. It runs in the browser and in Node.js.](https://vulcode.com/en/opensource/contributions/compromise)

- [**Pterodactyl** PHP · 9,537 stars A free, open source game server management panel built with PHP, React and Go. Every game server runs in its own isolated Docker container.](https://vulcode.com/en/opensource/contributions/pterodactyl)

## Describe your project.

A free quote comes back within an hour during working hours.

### Rather skip the form?

Ask in the chat or write to us directly.

Open the chat

- **Email**: [hello@vulcode.com](mailto:hello@vulcode.com)
- **Phone**: [+48 576 043 920](tel:+48576043920)
- **Discord**: [discord.gg/vulcode](https://discord.gg/vulcode)
