mirror of
https://github.com/gitpitch/gitpitch.git
synced 2024-04-18 07:30:55 +08:00
Code delimiter markdown injection by lang hint.
This commit is contained in:
parent
4b224b8b3f
commit
d776a34983
|
@ -86,7 +86,7 @@ public class CodeService {
|
||||||
|
|
||||||
if(downStatus == 0) {
|
if(downStatus == 0) {
|
||||||
String code = diskService.asText(pp, SOURCE_CODE);
|
String code = diskService.asText(pp, SOURCE_CODE);
|
||||||
if(isMarkdown(codePath)) {
|
if(isMarkdown(codePath, langHint)) {
|
||||||
code = prepMarkdown(code);
|
code = prepMarkdown(code);
|
||||||
}
|
}
|
||||||
theContent = buildCodeBlock(mdm.extractDelim(md),
|
theContent = buildCodeBlock(mdm.extractDelim(md),
|
||||||
|
@ -147,9 +147,9 @@ public class CodeService {
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isMarkdown(String codePath) {
|
private boolean isMarkdown(String codePath, String langHint) {
|
||||||
return (codePath != null) &&
|
return ((codePath != null) && codePath.endsWith(MARKDOWN_EXTENSION)) ||
|
||||||
codePath.endsWith(MARKDOWN_EXTENSION);
|
(langHint != null && langHint.toLowerCase().equals("markdown"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user