Skip to content

Commit

Permalink
fix: stop decoding entities with cheerio (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
eglavin committed Apr 28, 2024
2 parents 6b39d57 + 1f6de12 commit aaae442
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/strategies/csharp-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class CSharpProject implements IFileManager {

if (fileExists(filePath)) {
const fileContents = readFileSync(filePath, "utf8");
const $ = cheerio.load(fileContents, { xmlMode: true });
const $ = cheerio.load(fileContents, { xmlMode: true, decodeEntities: false });

const version = $("Project > PropertyGroup > Version").text();
if (version) {
Expand All @@ -47,7 +47,7 @@ export class CSharpProject implements IFileManager {

public write(fileState: FileState, newVersion: string) {
const fileContents = readFileSync(fileState.path, "utf8");
const $ = cheerio.load(fileContents, { xmlMode: true });
const $ = cheerio.load(fileContents, { xmlMode: true, decodeEntities: false });

$("Project > PropertyGroup > Version").text(newVersion);

Expand Down

0 comments on commit aaae442

Please sign in to comment.