@@ -35,11 +35,22 @@ function removeEmojiMetadata(content) {
3535}
3636
3737/**
38- * Clean up title formatting .
38+ * Remove standalone Description heading .
3939 */
40- function cleanTitle ( content ) {
41- // Remove duplicate # from titles (e.g., "# # Title" -> "# Title")
42- content = content . replace ( / ^ # \s + # \s + ( .+ ) $ / m, '# $1' ) ;
40+ function removeDescriptionHeading ( content ) {
41+ // Remove "## Description" heading when it appears alone on a line
42+ content = content . replace ( / ^ # # \s + D e s c r i p t i o n \s * $ / m, '' ) ;
43+ return content ;
44+ }
45+
46+ /**
47+ * Expand common abbreviations for readability.
48+ */
49+ function expandAbbreviations ( content ) {
50+ // Replace e.g., with "for example,"
51+ content = content . replace ( / \b e \. g \. , \s * / g, 'for example, ' ) ;
52+ // Replace i.e., with "that is,"
53+ content = content . replace ( / \b i \. e \. , \s * / g, 'that is, ' ) ;
4354 return content ;
4455}
4556
@@ -237,11 +248,12 @@ Each downsampled record includes three additional metadata columns:
237248function transformContent ( content , pluginName , config ) {
238249 // Apply transformations in order
239250 content = removeEmojiMetadata ( content ) ;
251+ content = removeDescriptionHeading ( content ) ;
240252 content = convertRelativeLinks ( content , pluginName ) ;
253+ content = expandAbbreviations ( content ) ;
241254 content = addProductShortcodes ( content ) ;
242255 content = enhanceOpeningParagraph ( content ) ;
243256 content = fixCodeBlockFormatting ( content ) ;
244- content = cleanTitle ( content ) ;
245257
246258 // Add schema requirements if applicable
247259 if (
0 commit comments