Skip to content

Commit

Permalink
Merge pull request #1110 from pjkaufman/master
Browse files Browse the repository at this point in the history
Fix: Ignore Images for `Quote Style`
  • Loading branch information
pjkaufman authored Jun 28, 2024
2 parents 952bba9 + a0772ae commit ca86c56
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions __tests__/quote-style.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,17 @@ ruleTest({
singleQuoteStyle: SingleQuoteStyles.SmartQuote,
},
},
{ // accounts for https://github.com/platers/obsidian-linter/issues/1109
testName: 'Make sure quotes in markdown image links get ignored',
before: dedent`
![link](https://test.it 'Test title')
`,
after: dedent`
![link](https://test.it 'Test title')
`,
options: {
singleQuoteStyle: SingleQuoteStyles.SmartQuote,
},
},
],
});
2 changes: 1 addition & 1 deletion src/rules/quote-style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class QuoteStyle extends RuleBuilder<QuoteStyleOptions> {
nameKey: 'rules.quote-style.name',
descriptionKey: 'rules.quote-style.description',
type: RuleType.CONTENT,
ruleIgnoreTypes: [IgnoreTypes.code, IgnoreTypes.inlineCode, IgnoreTypes.math, IgnoreTypes.yaml, IgnoreTypes.math, IgnoreTypes.inlineMath, IgnoreTypes.html, IgnoreTypes.link, IgnoreTypes.wikiLink, IgnoreTypes.templaterCommand],
ruleIgnoreTypes: [IgnoreTypes.code, IgnoreTypes.inlineCode, IgnoreTypes.math, IgnoreTypes.yaml, IgnoreTypes.math, IgnoreTypes.inlineMath, IgnoreTypes.html, IgnoreTypes.link, IgnoreTypes.wikiLink, IgnoreTypes.templaterCommand, IgnoreTypes.image],
});
}
get OptionsClass(): new () => QuoteStyleOptions {
Expand Down

0 comments on commit ca86c56

Please sign in to comment.