mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Tools: Escape HTML when generating changelog
This commit is contained in:
parent
03063f1137
commit
5292fc1402
@ -8,6 +8,16 @@ require('app-module-path').addPath(`${__dirname}/../ReactNativeClient`);
|
||||
|
||||
const { execCommand, githubUsername } = require('./tool-utils.js');
|
||||
|
||||
// From https://stackoverflow.com/a/6234804/561309
|
||||
function escapeHtml(unsafe) {
|
||||
return unsafe
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''');
|
||||
}
|
||||
|
||||
async function gitLog(sinceTag) {
|
||||
let lines = await execCommand(`git log --pretty=format:"%H::::DIV::::%ae::::DIV::::%an::::DIV::::%s" ${sinceTag}..HEAD`);
|
||||
lines = lines.split('\n');
|
||||
@ -245,7 +255,7 @@ function formatCommitMessage(msg, author, options) {
|
||||
output = output.replace(/\((#[0-9]+)\)$/, '');
|
||||
}
|
||||
|
||||
return output;
|
||||
return escapeHtml(output);
|
||||
}
|
||||
|
||||
function createChangeLog(logs, options) {
|
||||
|
Loading…
Reference in New Issue
Block a user