Skip to content

Commit 03af2fe

Browse files
authored
Merge pull request #1347 from mnaoumov/issue-1346
Don't replace spaces within embeds
2 parents 9496db6 + 2ea8bdd commit 03af2fe

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

__tests__/remove-multiple-spaces.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,15 @@ ruleTest({
254254
test test
255255
`,
256256
},
257+
{ // accounts for https://github.com/platers/obsidian-linter/issues/1346
258+
testName: 'Make sure that spaces within an embed are preserved',
259+
before: dedent`
260+
![](<./a b.md>)
261+
`,
262+
after: dedent`
263+
![](<./a b.md>)
264+
`,
265+
},
257266
],
258267
});
259268

src/rules/remove-multiple-spaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default class RemoveMultipleSpaces extends RuleBuilder<RemoveMultipleSpac
1313
nameKey: 'rules.remove-multiple-spaces.name',
1414
descriptionKey: 'rules.remove-multiple-spaces.description',
1515
type: RuleType.CONTENT,
16-
ruleIgnoreTypes: [IgnoreTypes.code, IgnoreTypes.inlineCode, IgnoreTypes.math, IgnoreTypes.inlineMath, IgnoreTypes.yaml, IgnoreTypes.link, IgnoreTypes.wikiLink, IgnoreTypes.tag, IgnoreTypes.table],
16+
ruleIgnoreTypes: [IgnoreTypes.code, IgnoreTypes.inlineCode, IgnoreTypes.math, IgnoreTypes.inlineMath, IgnoreTypes.yaml, IgnoreTypes.link, IgnoreTypes.wikiLink, IgnoreTypes.tag, IgnoreTypes.table, IgnoreTypes.image],
1717
});
1818
}
1919
get OptionsClass(): new () => RemoveMultipleSpacesOptions {

0 commit comments

Comments
 (0)