Skip to content

Conversation

@danvk
Copy link
Contributor

@danvk danvk commented Nov 11, 2025

Resolves #4279

Changes

This changes the markdown rule to ignore mid-word _ characters. This brings highlight.js in line with GFM (GitHub-Flavored Markdown). There's no official standard for Markdown and different renderers vary in how they handle mid_word underscores. Not italicizing them is the more conservative behavior, and avoids the common situation where a large fraction of your Markdown file turns italic with highlight.js when it does not with GitHub.

Checklist

  • Added markup tests
  • Updated the changelog at CHANGES.md

@github-actions
Copy link

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

4 files changed

Total change +22 B

View Changes
file base pr diff
es/core.min.js 8.19 KB 8.19 KB -1 B
es/highlight.min.js 8.19 KB 8.19 KB -1 B
es/languages/markdown.min.js 961 B 973 B +12 B
languages/markdown.min.js 960 B 972 B +12 B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(markdown) snake_case term causes italics in rest of file

1 participant