Fix adding comment to certain ftl files
This commit is contained in:
parent
813740a002
commit
249a7bde89
@ -100,9 +100,19 @@ function addCommentToSourceCode(params: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fileRelativePath.endsWith(".ftl")) {
|
if (fileRelativePath.endsWith(".ftl")) {
|
||||||
return toResult(
|
const comment = [`<#--`, ...commentLines.map(line => ` ${line}`), `-->`].join(
|
||||||
[`<#--`, ...commentLines.map(line => ` ${line}`), `-->`].join("\n")
|
"\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (sourceCode.trim().startsWith("<#ftl")) {
|
||||||
|
const [first, ...rest] = sourceCode.split(">");
|
||||||
|
|
||||||
|
const last = rest.join(">");
|
||||||
|
|
||||||
|
return [`${first}>`, comment, last].join("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return toResult(comment);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fileRelativePath.endsWith(".html") || fileRelativePath.endsWith(".svg")) {
|
if (fileRelativePath.endsWith(".html") || fileRelativePath.endsWith(".svg")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user