Fix italic formatting

This commit is contained in:
andrepimenta
2025-06-21 00:58:24 +01:00
parent cedde172bf
commit 300e569c96
3 changed files with 11 additions and 3 deletions

View File

@@ -4,6 +4,14 @@ All notable changes to the "claude-code-chat" extension will be documented in th
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
## [0.1.2] - 2025-06-20
### 🐛 Bug Fixes
- Fixed markdown parsing bug where underscores in code identifiers (like "protein_id") were incorrectly converted to italic formatting
- Updated regex pattern to only apply italic formatting when underscores are surrounded by whitespace or at string boundaries
- Preserved proper formatting for code snippets and technical identifiers
- Always show New Chat button
## [0.1.0] - 2025-06-20
### 🚀 Major Features Added

View File

@@ -2,7 +2,7 @@
"name": "claude-code-chat",
"displayName": "Claude Code Chat",
"description": "Beautiful Claude Code Chat Interface for VS Code",
"version": "0.1.1",
"version": "0.1.2",
"publisher": "AndrePimenta",
"author": "Andre Pimenta",
"repository": {

View File

@@ -1516,9 +1516,9 @@ const html = `<!DOCTYPE html>
// Bold
line = line.replace(/\\*\\*(.*?)\\*\\*/g, '<strong>$1</strong>');
// Italic
// Italic - only apply when underscores are surrounded by whitespace or at beginning/end
line = line.replace(/(?<!\\*)\\*(?!\\*)(.*?)\\*(?!\\*)/g, '<em>$1</em>');
line = line.replace(/_(.*?)_/g, '<em>$1</em>');
line = line.replace(/(^|\\s)_([^_\\s][^_]*[^_\\s]|[^_\\s])_(?=\\s|$)/g, '$1<em>$2</em>');
// Headers
if (/^####\\s+/.test(line)) {