Repository: platers/obsidian-linter (ts)

Issue:
Bug: header refactor alsto Capilizer words inside double (`)(`)
- [x] I have verified that I am on the latest version of the Linter

## Describe the Bug

Linter/Capitalize Headings style code inside `$= dataview etc` or `class: ` so it make the code break.

## How to Reproduce
1. turn on `Hedings should be formatted with capitalization` 
2. make it `ALL CAPS`
3. create a note with the next header
4. 

```markdown
## `= durationformat(date(this.day) - date(2023-10-06),"dd")` th days passed since the Black Shabbat
```
5. apply linter 
6. you will see 

``` markdown
## `= DURATIONFORMAT(DATE(THIS.DAY) - DATE(2023-10-06),"DD")` TH DAYS PASSED SINCE THE BLACK SHABBAT
```

## Expected Behavior

``` markdown
## `= durationformat(date(this.day) - date(2023-10-06),"dd")` TH DAYS PASSED SINCe THE BLACK SHABBAT
```

## Screenshots

If applicable, add screenshots to help explain your problem.

## Device

- [x] Desktop
- [ ] Mobile


Pull request:
Fix `Capitalize Headings` Affecting Inline Code in Headers
Fixes #921 

Changes Made:
- Added a UT for the scenario in question
- Removed a blank line
- Included inline code in the list of values to ignore for capitalize headings

Patch:
diff --git a/src/lang/helpers.ts b/src/lang/helpers.ts
index cfc22be..c442820 100644
--- a/src/lang/helpers.ts
+++ b/src/lang/helpers.ts
@@ -26,7 +26,6 @@ import uk from './locale/uk';
 import zhCN from './locale/zh-cn';
 import zhTW from './locale/zh-tw';
 
-
 type LanguageStrings = typeof en;
 
 export const localeMap: { [k: string]: Partial<LanguageStrings> } = {
diff --git a/src/rules/capitalize-headings.ts b/src/rules/capitalize-headings.ts
index 01abf70..9773f22 100644
--- a/src/rules/capitalize-headings.ts
+++ b/src/rules/capitalize-headings.ts
@@ -404,7 +404,7 @@ export default class CapitalizeHeadings extends RuleBuilder<CapitalizeHeadingsOp
       descriptionKey: 'rules.capitalize-headings.description',
       type: RuleType.HEADING,
       hasSpecialExecutionOrder: true, // this is meant to run at the end after all headers have been updated, added, or removed from the file
-      ruleIgnoreTypes: [IgnoreTypes.code, IgnoreTypes.yaml, IgnoreTypes.link, IgnoreTypes.wikiLink, IgnoreTypes.tag],
+      ruleIgnoreTypes: [IgnoreTypes.code, IgnoreTypes.inlineCode, IgnoreTypes.yaml, IgnoreTypes.link, IgnoreTypes.wikiLink, IgnoreTypes.tag],
     });
   }
   get OptionsClass(): new () => CapitalizeHeadingsOptions {


Test patch:
diff --git a/__tests__/capitalize-headings.test.ts b/__tests__/capitalize-headings.test.ts
index aa11b6f..c812f09 100644
--- a/__tests__/capitalize-headings.test.ts
+++ b/__tests__/capitalize-headings.test.ts
@@ -182,5 +182,17 @@ ruleTest({
         ignoreCasedWords: true,
       },
     },
+    { // accounts for https://github.com/platers/obsidian-linter/issues/921
+      testName: `Make sure that a header with inline code is properly ignored for capitalization`,
+      before: dedent`
+        ## \`= durationformat(date(this.day) - date(2023-10-06),"dd")\` th days passed since the Black Shabbat
+      `,
+      after: dedent`
+        ## \`= durationformat(date(this.day) - date(2023-10-06),"dd")\` TH DAYS PASSED SINCE THE BLACK SHABBAT
+      `,
+      options: {
+        style: 'ALL CAPS',
+      },
+    },
   ],
 });