Repository: platers/obsidian-linter (ts)

Issue:
Bug: `Empty Line Around Tables` messes up LaTeX with pipe character
## Describe the Bug

`Empty Line Around Tables` messes up LaTeX formulas with pipe (`|`) character

## How to Reproduce

Consider the following note

``` markdown
$|a| + |b|$
```

And enable `Empty Line Around Tables` rule.

## Expected Behavior

Markup unchanged

## Actual Behavior

```markdown
$|a

$|a| + |b|$
$|a
```

Pull request description:
Exclude math and inline math
Fixes #527 

Patch:
diff --git a/src/rules/empty-line-around-tables.ts b/src/rules/empty-line-around-tables.ts
index 01c7d70..e8227cd 100644
--- a/src/rules/empty-line-around-tables.ts
+++ b/src/rules/empty-line-around-tables.ts
@@ -22,7 +22,7 @@ export default class EmptyLineAroundTables extends RuleBuilder<EmptyLineAroundTa
     return RuleType.SPACING;
   }
   apply(text: string, options: EmptyLineAroundTablesOptions): string {
-    return ignoreListOfTypes([IgnoreTypes.yaml, IgnoreTypes.code], text, (text: string) => {
+    return ignoreListOfTypes([IgnoreTypes.yaml, IgnoreTypes.code, IgnoreTypes.math, IgnoreTypes.inlineMath], text, (text: string) => {
       return ensureEmptyLinesAroundTables(text);
     });
   }


Test patch:
diff --git a/__tests__/empty-line-around-tables.test.ts b/__tests__/empty-line-around-tables.test.ts
index 06eca7d..b3c20bf 100644
--- a/__tests__/empty-line-around-tables.test.ts
+++ b/__tests__/empty-line-around-tables.test.ts
@@ -47,5 +47,31 @@ ruleTest({
         > | quux     | quuz     |
       `,
     },
+    {
+      testName: 'Don\'t modify inline math',
+      before: dedent`
+        ${''}
+        $|a| + |b|$
+      `,
+      after: dedent`
+        ${''}
+        $|a| + |b|$
+      `,
+    },
+    {
+      testName: 'Don\'t modify math',
+      before: dedent`
+        ${''}
+        $$
+        |a| + |b|
+        $$
+      `,
+      after: dedent`
+        ${''}
+        $$
+        |a| + |b|
+        $$
+      `,
+    },
   ],
 });