File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 2929- Добавляет условие на выделенный текст, [ issue #20 ] ( https://github.com/devmanorg/github-copy-plugin/issues/20 )
3030- Исправлена подсветка синтаксиса в Replit, [ issue #21 ] ( https://github.com/devmanorg/github-copy-plugin/issues/21 )
3131- Исправлена инструкция для запуска в firefox, [ issue #19 ] ( https://github.com/devmanorg/github-copy-plugin/issues/19 )
32+ - Добавляет определения языка при копировании кода в gitlab, [ issue #16 ] ( https://github.com/devmanorg/github-copy-plugin/issues/16 )
Original file line number Diff line number Diff line change @@ -18,10 +18,17 @@ var copyMarkdownSnippetFromOtherSite = (function(){ // ES6 modules are not suppo
1818
1919 let preparedCodeSnippet = prepareCodeSnippet ( codeSnippet ) ;
2020
21+ let syntax = '' ;
22+
23+ // disabled if .md file because it is rendered on GitHub as HTML, not markdown.
24+ if ( ! pageName . endsWith ( '.md' ) ) {
25+ syntax = detectSyntaxByFilename ( pageName ) ;
26+ }
27+
2128 markdownSnippet = (
2229 `${ DELIMITER } \n` +
2330 `[_${ pageName } _](${ link } )\n` +
24- `\`\`\`\n${ preparedCodeSnippet } \n` +
31+ `\`\`\`${ syntax } \n${ preparedCodeSnippet } \n` +
2532 `\`\`\`\n`
2633 )
2734 }
You can’t perform that action at this time.
0 commit comments