Extendible-BBCode-Parser
Extendible-BBCode-Parser copied to clipboard
Introduces additional '#59' when transforming HTML tags
[email protected]
seems to get HTML tags wrong.
Taking <h1>Hello World!</h1>
as input, it produces <;h1>;Hello World!<;/h1>;
.
I had expected <h1>Hello World!</h1>
Reproduction:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="xbbcode.css">
<title>Example</title>
</head>
<body>
<script src="xbbcode.js"></script>
<script>
var result = XBBCODE.process({
text: "<h1>Hello World!</h1>",
});
console.error("Errors", result.error);
console.dir(result.errorQueue);
console.log(result.html);
</script>
</body>
</html>
Should be fixed with PR 31.
Sorry but this issue is not fixed with 0.2.2. The "security fixes" leave unwanted #&59; in the resulting string! return text .replaceAll("'", ''') .replaceAll('"', '"') .replaceAll(';', ';'); should better be return text .replaceAll(';', ';') .replaceAll("'", ''') .replaceAll('"', '"'); so that the semicolons which are inserted in the other lines on purpose are not replaced again