Skip to content

Commit a0fcd76

Browse files
authored
Merge pull request #33 from antauren/fix-github-md
GitHub: fix copying from .md
2 parents c22d472 + d7a1191 commit a0fcd76

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626

2727
...
2828

29+
## [1.2.1] - 2025-12-12
30+
31+
- Исправлено копирование кода из `.md` файлов на GitHub
32+
2933
## [1.2.0] - 2024-06-09
3034

3135
- Исправлено копирование кода на GitHub через выделение строк [issue #30](https://github.com/devmanorg/github-copy-plugin/issues/30)

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Devman Review Snippet",
3-
"version": "1.1",
3+
"version": "1.2.1",
44
"description": "Copy code and format for review on Devman site.",
55
"manifest_version": 3,
66

sites/github.com.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ var copyMarkdownSnippetFromGithub = (function(){ // ES6 modules are not supporte
8181
}
8282
}
8383

84+
if (filePath.toLowerCase().endsWith('.md')){
85+
reviewLink = reviewLink.replace('?plain=1', '').replace('#', '?plain=1#');
86+
}
87+
8488
let markdownSnippet = '';
8589
if (quitMode){
8690
markdownSnippet = (
@@ -102,7 +106,7 @@ var copyMarkdownSnippetFromGithub = (function(){ // ES6 modules are not supporte
102106
let syntax = '';
103107

104108
// disabled if .md file because it is rendered on GitHub as HTML, not markdown.
105-
if (!filePath.endsWith('.md')){
109+
if (!filePath.toLowerCase().endsWith('.md')){
106110
syntax = detectSyntaxByFilename(filePath);
107111
}
108112

0 commit comments

Comments
 (0)