Skip to content

Commit a8c605d

Browse files
committed
Add backwards compat for old setting and update Changelog
1 parent b72885c commit a8c605d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- Add `markdownCodeBlock.includeLanguageIdentifier` configuration option for Markdown block behavior.
1111
- Allows to set whether Markdown blocks should always include the [language identifier](https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks) which allows for syntax highlighting in some tools (for example github.com) but is not compatible with others (for example Slack).
1212
- The default is "`prompt`" which makes the extension always prompt when using the "Copy Snippet as Markdown Code Block" command.
13+
- **This replaces `snippet-copy.addLanguageIdentifierToMarkdownBlock`**. Switch to the new `snippet-copy.markdownCodeBlock.includeLanguageIdentifier` setting.
1314

1415
## [0.2.3]
1516

src/lib/textHelpers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ export function wrapTextInMarkdownCodeBlock(document: TextDocument, text: string
4747
}
4848

4949
export async function includeLanguageIdentifier(config: ExtensionConfig): Promise<boolean> {
50+
if (config.addLanguageIdentifierToMarkdownBlock) {
51+
return true;
52+
}
53+
5054
let includeLanguageIdentifier = config.markdownCodeBlock.includeLanguageIdentifier;
5155

5256
if (includeLanguageIdentifier === 'prompt') {

0 commit comments

Comments
 (0)