Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

#misc
.idea
.general-styles.css.map
.general-styles.css.map
node_modules/
1 change: 1 addition & 0 deletions guest-book.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<span id="month"></span>
</div>

<script src="node_modules/dompurify/dist/purify.min.js"></script>
<script src="js/guest-book.js"></script>

</body>
Expand Down
6 changes: 5 additions & 1 deletion js/guest-book.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ let now = new Date(),
nowYear = now.getFullYear();
daysWeek = ['вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'];

function sanitizeHtml(html) {
return DOMPurify.sanitize(html, { USE_PROFILES: { html: true } });
}

function daysInMonth (month, year) {
return new Date(year, month, 0).getDate();
}
Expand All @@ -30,7 +34,7 @@ console.log(daysWeeka);

let days = outputDays();

calendar.innerHTML = days;
calendar.innerHTML = sanitizeHtml(days);



Expand Down
32 changes: 32 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "workspace",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/tmrr13/guest-book.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/tmrr13/guest-book/issues"
},
"homepage": "https://github.com/tmrr13/guest-book#readme",
"dependencies": {
"dompurify": "^3.3.1"
}
}